home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / INFOTEXT / INTERRUP.LZH / INTERRUP.TXT
Text File  |  1989-11-07  |  137KB  |  3,285 lines

  1. While you may want to remove the following header from this file for
  2. your own use, please do not redistribute the file without it, so that
  3. credit may be given where credit is due.
  4. -----------------------------------------------------------
  5. Last edited 12/5/87
  6.  
  7. This list is the result of the time and effort of a large number of people,
  8. among them
  9.      Janet Jack        January 1985  (original list)
  10.      J. Weaver Jr.     January 1985
  11.      John Cooper       February 1985
  12.      Skip Gilbrech     February 1985
  13.      Bob Jack
  14.      Jim Kyle          April 1985
  15.      John Ruschmeyer   <ihnp4!vax135!petsd!moncol!john> August 1985
  16.      Bill Frolik       <ihnp4!hplabs!hp-pcd!bill>       August 1985
  17.      Ross M. Greenberg <greenber%timeinc.uucp@brl.arpa> August 1985
  18.  
  19.      Dan Lanciani  <ddl@harvard.*>   TANDY function calls
  20.      Ralf Brown    <ralf@cs.cmu.edu> INT 24h and DOS func 59h error codes
  21.      Dan Davison   <dd@lanl.gov>     DOS 3.3 function calls      11/87
  22.      Bill White    <wwhite@teknowledge-vaxc.arpa> DOS 3.3        11/87
  23.      Richard Hargrove <killer!richardh@harvard.harvard.edu> EGA  11/87
  24.      Vincent Broman <broman@bugs.nosc.mil> Cordata BIOS/Minix    12/87
  25.  
  26. Information on the INT 10h functions supported by the EGA BIOS was derived
  27. from the article "Graphic Enhancement" found in the April 1985 _PC Tech
  28. Journal_, pages 58ff., and is marked with the string {ega}. jrh.
  29.  
  30. Information on functions unique to the Portable PC and the Convertible was
  31. derived from a similar list compiled by David E. Powell, and added by
  32. Ralf Brown on 11/14/87.
  33.  
  34. Information on LIM EMS 3.2 functions was derived from _Advanced_MSDOS_, by
  35. Ray Duncan. Added by Ralf Brown 11/19/87.
  36.  
  37. Information on LIM EMS 4.0 functions was derived from the transcription of
  38. the specification by Dick Flanagan and Ben Lomond.  Added by Ralf Brown,
  39. 11/20/87
  40. -----------------------------------------------------------
  41. If you know any information which is not in this list, or which is
  42. incorrect, please let me know!
  43.  
  44.                Ralf Brown
  45.          Arpa: ralf@cs.cmu.edu
  46.          UUCP: {uunet,ucbvax,harvard}!cs.cmu.edu!ralf
  47.          BIT:  ralf%cs.cmu.edu@cmuccvma
  48.          FIDO: Ralf Brown at 1:129/31  (more subject to change than the others)
  49. -----------------------------------------------------------
  50. INT 0 - DIVIDE ERROR
  51.    Automatically called at end of DIV or IDIV operation that results in
  52.    error.  Normally set by DOS to display an error message and abort the
  53.    program.
  54. -----------------------------------------------------------
  55. INT 1 - SINGLE-STEP
  56.    Generated at end of each machine instruction if TF bit in FLAGS is set.
  57.    This is what makes the T command of DEBUG work for single-stepping.  Is
  58.    not generated after MOV to segment register or POP of segment register
  59.    (unless you have a very early 8088 with a microcode bug).
  60. -----------------------------------------------------------
  61. INT 2 - NMI (Non Maskable Interrupt)
  62.    Generated by NMI signal in hardware. Used in IBM for memory parity
  63.    error trapping.
  64. -----------------------------------------------------------
  65. INT 3 - 1-BYTE INTERRUPT
  66.    Generated by opcode 0CCh. Similar to 8080's RST instruction.  Generally
  67.    used to set breakpoints for DEBUG.
  68. -----------------------------------------------------------
  69. INT 4 - Overflow (internal interrupt)
  70.    Generated by INTO instruction if OF flag is set. If flag is not set,
  71.    INTO is effectively a NOP. Used to trap any arithmetic errors when
  72.    program is ready to handle them rather than immediately when they occur.
  73. -----------------------------------------------------------
  74. INT 5 - Print-Screen Key
  75.    Automatically called by keyboard scan when print-screen key is pressed.
  76.    Normally executes routine to print the screen, but may call any routine
  77.    that can safely be executed from inside the keyboard scanner.  Status
  78.    and result byte for default handler is at address 0050:0000.
  79. -----------------------------------------------------------
  80. INT 5 - BOUND check failed (80286 internal interrupt)
  81. -----------------------------------------------------------
  82. INT 6 - Undefined Opcode (80286 internal interrupt)
  83. -----------------------------------------------------------
  84. INT 7 - No Math Unit Available (80286 protected-mode internal)
  85. -----------------------------------------------------------
  86. INT 8 thru 0F - Vectored Hardware Lines
  87.    In IBM, these 8 interrupts are generated in response to IRQ 0 through
  88.    IRQ 7 (if enabled via port 21h).
  89.                                          [Tandy 1000]
  90.         IRQ0  -  timer interrupt
  91.         IRQ1  -  keyboard interrupt
  92.         IRQ2  -  EGA vertical retrace    [fixed disk]
  93.         IRQ3  -  serial port 2 (com2:)
  94.         IRQ4  -  serial port 1 (com1:)
  95.         IRQ5  -  fixed disk              [60 Hz ram refresh]
  96.                  (LPT2 on PC/AT)
  97.         IRQ6  -  diskette interrupt
  98.         IRQ7  -  PPI interrupt (lpt1:, lpt2:)
  99. -----------------------------------------------------------
  100. INT 8 - Double Fault (80286 protected-mode internal)
  101. -----------------------------------------------------------
  102. INT 9 - Math Unit Protection Fault (80286 protected-mode internal)
  103. -----------------------------------------------------------
  104. INT 0A - Invalid Task State Segment (80286 protected-mode internal)
  105. -----------------------------------------------------------
  106. INT 0B - Not Present (80286 protected-mode internal)
  107. -----------------------------------------------------------
  108. INT 0C - Stack Fault (80286 protected-mode internal)
  109. -----------------------------------------------------------
  110. INT 0D - General Protection Violation (80286 internal interrupt)
  111.          Called in real mode when an instruction attempts to access a word
  112.          operand located at offset 0FFFFh
  113. -----------------------------------------------------------
  114. INT 0E - Page Fault (80386 native-mode internal)
  115. -----------------------------------------------------------
  116. INT 10 - VIDEO - SET VIDEO MODE
  117.         AH = 0
  118.         AL = mode
  119.             0 = 40x25 B&W
  120.             1 = 40x25 color
  121.             2 = 80x25 B&W
  122.             3 = 80x25 color
  123.             4 = 320x200 graphics, 4 color
  124.             5 = 320x200 graphics, 4-tone gray scale
  125.             6 = 640x200 graphics, B&W
  126.             7 = monochrome
  127.             8 = 160x200 graphics, 16 color (PCjr/Tandy 1000)
  128.             9 = 320x200 graphics, 16 color(PCjr/Tandy 1000)
  129.            0Ah = 640x200 graphics, 4 color (PCjr/Tandy 1000)
  130.            0Bh = reserved (used internally by EGA BIOS)
  131.            0Ch = reserved (used internally by EGA BIOS)
  132.            0Dh = 320x200 graphics, 16 color (EGA)
  133.            0Eh = 640x200 graphics, 16 color (EGA)
  134.            0Fh = 640x350 graphics, monochrome (EGA)
  135.            10h = 640x350 graphics, 4 or 16 color (EGA)
  136.            11h = ???x??? graphics, ??? colors (VGA)
  137.            12h = ???x??? graphics, ??? colors (VGA)
  138.            13h = ???x??? graphics, ??? colors (VGA)
  139.            30h = ???x??? (AT&T 6300)
  140.            40h = 640x400 graphics (AT&T 6300)
  141.            60h = 400 line graphics+80 column text (Corona/Cordata BIOS v4.10+)
  142.            61h = 400 line graphics (Corona/Cordata BIOS v4.10+)
  143.            74h = 640x400 graphics (Toshiba 3100)
  144. -----------------------------------------------------------
  145. INT 10 - VIDEO - SET CURSOR CHARACTERISTICS
  146.         AH = 1
  147.         CH bits 5-6 = blink attribute
  148.                      (00=normal, 01=invisible, 10 = slow, 11=fast)
  149.         CH bits 0-4 = start line for cursor in char. cell
  150.         CL bits 0-4 = end line for cursor in char. cell
  151. -----------------------------------------------------------
  152. INT 10 - VIDEO - SET CURSOR POSITION
  153.         AH = 2
  154.         DH,DL = row, column (0,0 = upper left)
  155.         BH = page number
  156.             0 in graphics modes
  157.             0-3 in modes 2&3
  158.             0-7 in modes 0&1
  159. -----------------------------------------------------------
  160. INT 10 - VIDEO - READ CURSOR POSITION
  161.         AH = 3
  162.         BH = page number
  163.             0 in graphics modes
  164.             0-3 in modes 2&3
  165.             0-7 in modes 0&1
  166. Return: DH = row
  167.         DL = column
  168.         CH = cursor start line
  169.         CL = cursor end line
  170. -----------------------------------------------------------
  171. INT 10 - VIDEO - READ LIGHT PEN POSITION
  172.         AH = 4
  173. Return: AH = 0: light pen switch not activated
  174.         AH = 1: light pen values in registers
  175.             DH = row of current position
  176.             DL = column of current position
  177.             CH = raster line (0-199) {ega} old graphics modes
  178.             CX = {ega} raster line (0-nnn) new graphics modes
  179.             BX = pixel column (0-319 or 0-639)
  180. -----------------------------------------------------------
  181. INT 10 - VIDEO - SELECT DISPLAY PAGE
  182.         AH = 5
  183.         AL =
  184.             0-7: new page value for modes 0 & 1
  185.             0-3: new page value for modes 2 & 3
  186.             80h: read CRT/CPU page registers [PCjr only]
  187.             81h: set CPU page register to value in BL [PCjr only]
  188.             82h: set CRT page register to value in BH [PCjr only]
  189.             83h: set both display registers [PCjr only]
  190.             {Corona/Cordata BIOS v4.10+}
  191.             0: set address of graphics bitmap buffer (video modes 60h,61h)
  192.                BX = segment of buffer
  193.             0Fh: get address of graphics bitmap buffer (video modes 60h,61h)
  194. Return: BH = CRT page register (if AL >= 80h)
  195.         BL = CPU page register (if AL >= 80h)
  196.         DX = segment of graphics bitmap buffer (video modes 60h,61h; AL=0Fh)
  197. -----------------------------------------------------------
  198. INT 10 - VIDEO - SCROLL PAGE UP
  199.         AH = 6
  200.         AL = number of lines to scroll window (0 = blank whole window)
  201.         BH = attributes to be used on blanked lines
  202.         CH,CL = row,column of upper left corner of window to scroll
  203.         DH,DL = row,column of lower right corner of window
  204. -----------------------------------------------------------
  205. INT 10 - VIDEO - SCROLL PAGE DOWN
  206.         AH = 7
  207.         AL = number of lines to scroll window (0 = blank whole window)
  208.         BH = attributes to be used on blanked lines
  209.         CH,CL = row,column of upper left corner of window to scroll
  210.         DH,DL = row,column of lower right corner of window
  211. -----------------------------------------------------------
  212. INT 10 - VIDEO - READ ATTRIBUTES/CHARACTER AT CURSOR POSITION
  213.         AH = 8
  214.         BH = display page
  215. Return: AL = character
  216.         AH = attribute of character (alpha modes)
  217. -----------------------------------------------------------
  218. INT 10 - VIDEO - WRITE ATTRIBUTES/CHARACTERS AT CURSOR POS
  219.         AH = 9
  220.         AL = character
  221.         BH = display page - alpha mode
  222.         BL = attributes of char (alpha modes) or color (graphics modes)
  223.              if bit 7 == 1 in graphics mode, character is xor'ed onto screen
  224.         CX = number of times to write character
  225. -----------------------------------------------------------
  226. INT 10 - VIDEO - WRITE CHARACTERS ONLY AT CURSOR POS
  227.         AH = 0Ah
  228.         AL = character
  229.         BH = display page - alpha mode
  230.         BL = color of character (graphics mode)
  231.         CX = number of times to write character
  232.              {ega} in graphics modes, replication count in CX works correctly
  233.              only if all character written are contains on the same row
  234. -----------------------------------------------------------
  235. INT 10 - VIDEO - SET COLOR PALETTE
  236.         {ega} CGA-compatible modes
  237.         AH = 0Bh
  238.         BH = palette color ID
  239.         BL = color to be used with color ID
  240.         {ega} (graphics modes)
  241.         if BH == 0, BL contains background and border colors (0-15)
  242.         if BH == 1, BL contains palette being selected (0-1)
  243.               (text modes)
  244.         if BH == 0, BL contains border color (0-15) only
  245.                     {ega} BL contains border color (0-15) and high-intensity
  246.                     background color (16-31)
  247. -----------------------------------------------------------
  248. INT 10 - VIDEO - WRITE DOT ON SCREEN
  249.         AH = 0Ch
  250.         AL = color of dot (0/1 in mode 6, 0-3 in modes 4 and 5)
  251.              if bit 7 set, new color will be XORed with current pixel
  252.         DX = row (0 - 199)
  253.         CX = column (0 - 319 in modes 4/5, 0 - 639 in mode 6)
  254.         Note: video modes 4-6 only
  255. -----------------------------------------------------------
  256. INT 10 - VIDEO - READ DOT ON SCREEN
  257.         AH = 0Dh
  258.         CX = column (0 - 319 or 639)
  259.         DX = row (0 - 199)
  260. Return: AL = color read
  261. -----------------------------------------------------------
  262. INT 10 - VIDEO - WRITE CHARACTER AND ADVANCE CURSOR (TTY WRITE)
  263.         AH = 0Eh
  264.         AL = character
  265.         BH = display page (alpha modes)
  266.         BL = foreground color (graphics modes)
  267. -----------------------------------------------------------
  268. INT 10 - VIDEO - GET CURRENT VIDEO MODE
  269.         AH = 0Fh
  270. Return: AH = number of columns on screen
  271.         AL = current video mode
  272.         BH = current active display page
  273. -----------------------------------------------------------
  274. INT 10 - VIDEO - SET PALETTE REGISTERS (PCjr, TANDY 1000, {ega})
  275.         AH = 10h
  276.         AL = 0: set palette register
  277.                 BL = palette register to set
  278.                 BH = color value to store
  279.         AL = 1: set border color register
  280.                 BH = color value to store
  281.         AL = 2: set all palette registers
  282.                 ES:DX = pointer to 17-byte list
  283.                         bytes 0-15 = values for palette regs. 0-15
  284.                         byte 16 = value for border register
  285.         {ega}
  286.         AL = 3: toggle intensity/blinking bit
  287.                 BL = 0: enable intensity
  288.                 BL = 1: enable blink
  289. -----------------------------------------------------------
  290. INT 10 - Character generator functions {ega}
  291.         AH = 11h
  292.         The following functions will cause a mode set, completely resetting
  293.         the video environment, but without clearing the video buffer
  294.         AL = 00h, 10h: load user-specified patterns
  295.             ES:BP = pointer to user table
  296.             CX    = count of patterns to store
  297.             DX    = character offset into map 2 block
  298.             BL    = block to load in map 2
  299.             BH    = number of bytes per character pattern
  300.         AL = 01h, 11h: load ROM monochrome patterns (8 by 14)
  301.             BL    = block to load
  302.         AL = 02h, 12h: load ROM 8 by 8 double-dot patterns
  303.             BL    = block to load
  304.         AL = 03h: set block specifier
  305.             BL    = block specifier
  306.         The routines called with AL=1x are designed to be called only
  307.         immediately after a mode set and are similar to the routines called
  308.         with AL=0x, except that:
  309.               Page 0 must be active.
  310.               Bytes/character is recalculated.
  311.               Max character rows is recalculated.
  312.               CRT buffer length is recalculated.
  313.               CRTC registers are reprogrammed as follows:
  314.                      R09 = bytes/char-1 ; max scan line (mode 7 only)
  315.                      R0A = bytes/char-2 ; cursor start
  316.                      R0B = 0            ; cursor end
  317.                      R12 = ((rows+1)*(bytes/char))-1 ; vertical display end
  318.                      R14 = bytes/char   ; underline loc
  319.                            (*** BUG: should be 1 less ***)
  320.         The following functions are meant to be called only after a mode set:
  321.         AL = 20h: user 8 by 8 graphics characters (INT 1FH)
  322.             ES:BP = pointer to user table
  323.         AL = 21h: user graphics characters
  324.             ES:BP = pointer to user table
  325.             CX    = bytes per character
  326.             BL    = row specifier
  327.                    0: user set - DL = number of rows
  328.                    1: 14 rows
  329.                    2: 25 rows
  330.                    3: 43 rows
  331.         AL = 22h: ROM 8 by 14 set
  332.             BL    = row specifier
  333.         AL = 23h: ROM 8 by 8 double dot
  334.             BL    = row specifier
  335.         AL = 30h: return information
  336.             BH    = pointer specifier
  337.                    0: INT 1Fh pointer
  338.                    1: INT 44h pointer
  339.                    2: ROM 8 by 14 character font pointer
  340.                    3: ROM 8 by 8 double dot font pointer
  341.                    4: ROM 8 by 8 DD font (top half)
  342.                    5: ROM alpha alternate (9 by 14) pointer
  343.             Returns: ES:BP = specified pointer value
  344.                      CX    = bytes/character
  345.                      DL    = character rows on screen
  346. -----------------------------------------------------------
  347. INT 10 - Alternate function select {ega}
  348.         AH = 12h
  349.         BL = 10h: return EGA information
  350.              Returns:
  351.              BH = 0: color mode in effect (3Dx)
  352.                   1: mono mode in effect (3Bx)
  353.              BL = 0:  64k bytes memory installed
  354.                   1: 128k bytes memory installed
  355.                   2: 192k bytes memory installed
  356.                   3: 256k bytes memory installed
  357.              CH = feature bits
  358.              CL = switch settings
  359.         BL = 20h: select alternate print screen routine
  360. -----------------------------------------------------------
  361. INT 10 - WRITE STRING (PC/AT ONLY)
  362.         AH = 13h
  363.         AL = mode
  364.             bit 0: set in order to move cursor after write
  365.             bit 1: set if string contains alternating characters and attributes
  366.         BL = attribute if AL bit 1 clear
  367.         BH = display page number
  368.         DH,DL = row,column of starting cursor position
  369.         CX = length of string
  370.         ES:BP = pointer to start of string
  371. -----------------------------------------------------------
  372. INT 10 - LOAD LCD CHARACTER FONT (CONVERTIBLE ONLY)
  373.         AH = 14h
  374.         AL = 0 load user-specified font
  375.             ES:DI = pointer to character font
  376.             BH = number of bytes per character
  377.             BL = 0: load main font (block 0)
  378.                  1: load alternate font (block 1)
  379.             CX = number of characters to store
  380.             DX = character offset into RAM font area
  381.         AL = 1 load system rom default font
  382.             BL = 0: load main font (block 0)
  383.                  1: load alternate font (block 1)
  384.         AL = 2 set mapping of LCD high intensity attributes
  385.             BL = 0: ignore high intensity attribute
  386.                  1: map high intensity to underscore
  387.                  2: map high intensity to revrese video
  388.                  3: map high intensity to selected alternate font
  389. -----------------------------------------------------------
  390. INT 10 - GET PHYSICAL DISPLAY PARAMETERS (CONVERTIBLE ONLY)
  391.         AH = 15h
  392. Return: AX = alternate display adapter type
  393.         ES:DI = pointer to parameter table
  394.                word 0: monitor model number
  395.                     1: vertical pixels per meter
  396.                     2: horizontal pixels per meter
  397.                     3: total vertical pixels
  398.                     4: total horizontal pixels
  399.                     5: horizontal pixel separation in micrometers
  400.                     6: vertical pixel separation in micrometers
  401. -----------------------------------------------------------
  402. INT 10 - GET VIDEO RAM ADDRESS [TANDY 1000]
  403.         AH = 70h
  404. Return: AX  = segment address of the following
  405.         [BX] = offset address of green plane
  406.         [CX] = segment address of green plane
  407.         [DX] = segment address of red/blue plane
  408.                (red offset = 0, blue offset = 4000)
  409. -----------------------------------------------------------
  410. INT 10 - GET INCRAM ADDRESSES [TANDY 1000]
  411.         AH = 71h
  412. Return: AX  = segment address of the following
  413.         [BX] = segment address of INCRAM
  414.         [CX] = offset address of INCRAM
  415. -----------------------------------------------------------
  416. INT 10 - SCROLL SCREEN RIGHT [TANDY 1000]
  417.         AH = 72h
  418.         AL = number of columns blanked at left of window
  419.              0 = blank entire window
  420.         BH = attributes to be used on blank columns
  421.         CH,CL = row, column of upper left corner of window
  422.         DH,DL = row, column of lower right corner
  423. ----------------------------------------------------------
  424. INT 10 - SCROLL SCREEN LEFT [TANDY 1000]
  425.         AH = 73h
  426.         AL = number of columns blanked at right of window
  427.              0 = blank entire window
  428.         BH = attributes to be used on blank columns
  429.         CH,CL = row, column of upper left corner of window
  430.         DH,DL = row, column of lower right corner
  431. -----------------------------------------------------------
  432. INT 10 - Get Video Buffer (TopView/DESQview/TaskView)
  433.         AH = FEh
  434.         ES:DI = segment:offset of assumed video buffer
  435. Return: ES:DI = segment:offset of actual video buffer
  436. -----------------------------------------------------------
  437. INT 10 - Update Video Buffer (TopView/DESQview/TaskView)
  438.         AH = FFh
  439.         CX = number of sequential characters that have been modified
  440.         DI = offset of first character that has been modified
  441.         ES = segment of video buffer
  442. -----------------------------------------------------------
  443. INT 11 - EQUIPMENT DETERMINATION
  444. Return: AX = "equipment flag" bits
  445.             0       diskette installed
  446.             1       8087 present
  447.             2,3     always = 11
  448.             4,5     initial video mode
  449.                     01 = 40x25 COLOR
  450.                     10 = 80x25 COLOR
  451.                     11 = 80X25 IBM monochrome
  452.             6,7     number of diskette drives (only if bit 0 = 1)
  453.                     00 = 1, 01 = 2
  454.             8       0 = dma present, 1= no dma on system (PCjr?)
  455.             9,10,11 number of RS232 cards
  456.             12      game I/O attached
  457.             13      serial printer installed (IBM-PCjr)
  458.                     internal modem installed (Convertible)
  459.             14,15   number of printers
  460. -----------------------------------------------------------
  461. INT 12 - MEMORY SIZE
  462. Return: AX = number of contiguous 1K blocks of memory
  463. -----------------------------------------------------------
  464. INT 13 - RESET DISK SYSTEM
  465.         AH = 0
  466. -----------------------------------------------------------
  467. INT 13 - STATUS OF DISK SYSTEM
  468.         AH = 1
  469. Return: AL = status
  470.             00h = successful completion
  471.             01h = bad command
  472.             02h = address mark not found
  473.             03h = write attempted on write-protected disk
  474.             04h = sector not found
  475.             05h = reset failed (hard disk)
  476.             06h = diskette changed
  477.             07h = parameter act. failed (hard disk)
  478.             08h = DMA overrun
  479.             09h = DMA across 64K boundary
  480.             0Ah = bad sector detected (hard disk)
  481.             0Bh = bad track detected (hard disk)
  482.             0Ch = unsupported track
  483.             10h = bad CRC/ECC
  484.             11h = data ECC corrected
  485.             20h = controller failure
  486.             40h = seek failed
  487.             80h = time out
  488.             AAh = drive not ready (hard disk)
  489.             BBh = undefined error (hard disk)
  490. -----------------------------------------------------------
  491. INT 13 - READ SECTORS INTO MEMORY
  492.         AH = 2
  493.         AL = number of sectors to read
  494.         CH = track (for hard disk, bits 8,9 in high bits of CL)
  495.         CL = sector
  496.         DH = head
  497.         DL = drive
  498.         ES:BX = address of buffer to fill
  499. Return: CF = set if error occurred
  500.         AH = status (see AH=1 above)
  501.         AL = number of sectors read
  502. -----------------------------------------------------------
  503. INT 13 - WRITES SECTORS FROM MEMORY
  504.         AH = 3
  505.         AL = number of sectors to write
  506.         CH = track (for hard disk, bits 8,9 in high bits of CL)
  507.         CL = sector
  508.         DH = head
  509.         DL = drive
  510.         ES:BX = address of buffer
  511. Return: CF = set if error occurred
  512.         AH = status (see AH=1 above)
  513.         AL = number of sectors written
  514. -----------------------------------------------------------
  515. INT 13 - VERIFY SECTORS
  516.         AH = 4
  517.         AL = number of sectors to verify
  518.         CH = track (for hard disk, bits 8,9 in high bits of CL)
  519.         CL = sector
  520.         DH = head
  521.         DL = drive
  522. Return: CF = set if error occurred
  523.         AH = status (see AH=1 above)
  524.         AL = number of sectors verified
  525. -----------------------------------------------------------
  526. INT 13 - FORMAT DISKETTE TRACK (FLOPPY)
  527.         AH = 5
  528.         AL = number of sectors to create on this track
  529.         CH = track
  530.         CL = sector
  531.         DH = head
  532.         DL = drive
  533.         ES:BX = pointer to array of 4-byte address fields
  534.                byte 1 = track
  535.                byte 2 = head
  536.                byte 3 = sector
  537.                byte 4 = bytes/sector  0=128, 1=256, 2=512, 3=1024
  538. Return: CF set if error occurred
  539.         AH = status code (see AH=1 above)
  540. -----------------------------------------------------------
  541. INT 13 - FORMAT TRACK (HARD DISK)
  542.         AH = 5
  543.         AL = interleave value (XT only)
  544.         ES:BX = 512-byte format buffer
  545.                 the first 2*(sectors/track) bytes contain F,N for each sector
  546.                    F = 00 for good sector, 80h for bad sector
  547.                    N = sector number
  548.         CH = cylinder number (bits 8,9 in high bits of CL)
  549.         CL = sector number
  550.         DH = head
  551.         DL = drive
  552. Return: AH = status code (see AH=1 above)
  553. -----------------------------------------------------------
  554. INT 13 - FORMAT TRACK AND SET BAD SECTOR FLAGS (XT, PORTABLE ONLY)
  555.         AH = 6
  556.         AL = interleave value (XT only)
  557.         ES:BX = 512-byte format buffer
  558.                 the first 2*(sectors/track) bytes contain F,N for each sector
  559.                    F = 00 for good sector, 80h for bad sector
  560.                    N = sector number
  561.         CH = cylinder number (bits 8,9 in high bits of CL)
  562.         CL = sector number
  563.         DH = head
  564.         DL = drive
  565. Return: AH = status code (see AH=1 above)
  566. -----------------------------------------------------------
  567. INT 13 - FORMAT DRIVE STARTING AT GIVEN TRACK (XT, PORTABLE ONLY)
  568.         AH = 7
  569.         AL = interleave value (XT only)
  570.         ES:BX = 512-byte format buffer, see AH=6 above
  571.         CH = cylinder number (bits 8,9 in high bits of CL)
  572.         CL = sector number
  573.         DH = head
  574.         DL = drive
  575. Return: AH = status code (see AH=1 above)
  576. -----------------------------------------------------------
  577. INT 13 - GET CURRENT DRIVE PARAMETERS (PC/XT and PC/AT)
  578.         AH = 8
  579.         DL = DRIVE NUMBER
  580. Return: CF set on error
  581.         AH = status code (see AH=1 above)
  582.         DL = number of consecutive acknowledging drives
  583.         DH = maximum value for head number
  584.         CL = maximum value fo sector number
  585.         CH = maximum value for cylinder number
  586. -----------------------------------------------------------
  587. INT 13 - INITIALIZE TWO FIXED DISK BASE TABLES (PC/AT ONLY)
  588.         AH = 9
  589. Return: CF set on error
  590.         AH = status code (see AH=1 above)
  591.         INT 41h points to table for drive 0
  592.         INT 46h points to table for drive 1
  593. -----------------------------------------------------------
  594. INT 13 - READ LONG (PC/AT ONLY)
  595.         AH = 0Ah
  596.         DL = drive ID
  597.         DH = head
  598.         CH = cylinder (bits 8,9 in high bits of CL)
  599.         CL = sector
  600.         ES:BX = pointer to buffer to fill
  601. Return: CF set on error
  602.         AH = status code (see AH=1 above)
  603. -----------------------------------------------------------
  604. INT 13 - WRITE LONG (PC/AT ONLY)
  605.         AH = 0Bh
  606.         DL = drive ID
  607.         DH = head
  608.         CH = cylinder (bits 8,9 in high bits of CL)
  609.         CL = sector
  610.         ES:BX = pointer to buffer containing data
  611. Return: CF set on error
  612.         AH = status code (see AH=1 above)
  613. -----------------------------------------------------------
  614. INT 13 - SEEK TO CYLINDER (PC/XT and PC/AT)
  615.         AH = 0Ch
  616.         DL = drive ID
  617.         DH = head
  618.         CH = cylinder (bits 8,9 in high bits of CL)
  619. Return: CF set on error
  620.         AH = status code (see AH=1 above)
  621. -----------------------------------------------------------
  622. INT 13 - ALTERNATE DISK RESET (PC/XT and PC/AT)
  623.         AH = 0Dh
  624.         DL = drive ID
  625. Return: CF set on error
  626.         AH = status code (see AH=1 above)
  627. -----------------------------------------------------------
  628. INT 13 - READ SECTOR BUFFER (XT, PORTABLE ONLY)
  629.         AH = 0Eh
  630.         AL = number of sectors
  631.         CH = cylinder (bits 8,9 in top two bits of CL)
  632.         CL = sector number
  633.         DH = head number
  634.         DL = drive number
  635.         ES:BX = pointer to buffer
  636. Return: AL = number of sectors actually transferred
  637.         AH = status code (see AH=1 above)
  638. -----------------------------------------------------------
  639. INT 13 - WITE SECTOR BUFFER (XT, PORTABLE ONLY)
  640.         AH = 0Fh
  641.         AL = number of sectors
  642.         CH = cylinder (bits 8,9 in top two bits of CL)
  643.         CL = sector number
  644.         DH = head number
  645.         DL = drive number
  646.         ES:BX = pointer to buffer
  647. Return: AL = number of sectors actually transferred
  648.         AH = status code (see AH=1 above)
  649. -----------------------------------------------------------
  650. INT 13 - TEST FOR DRIVE READY (PC/AT ONLY)
  651.         AH = 10h
  652.         DL = drive ID
  653. Return: CF set on error
  654.         AH = status code (see AH=1 above)
  655. -----------------------------------------------------------
  656. INT 13 - RECALIBRATE DRIVE (PC/XT and PC/AT)
  657.         AH = 11h
  658.         DL = drive ID
  659. Return: CF set on error
  660.         AH = status code (see AH=1 above)
  661. -----------------------------------------------------------
  662. INT 13 - CONTROLER RAM DIAGNOSTIC (XT, PORTABLE ONLY)
  663.         AH = 12h
  664. Return: AH = status code (see AH=1 above)
  665. -----------------------------------------------------------
  666. INT 13 - DRIVE DIAGNOSTIC (XT, PORTABLE ONLY)
  667.         AH = 13h
  668. Return: AH = status code (see AH=1 above)
  669. -----------------------------------------------------------
  670. INT 13 - CONTROLLER DIAGNOSTICS (PC/AT ONLY)
  671.         AH = 14h
  672. Return: CF set on error
  673.         AH = status code (see AH=1 above)
  674. -----------------------------------------------------------
  675. INT 13 - GET DISK TYPE (PC/AT ONLY)
  676.         AH = 15h
  677.         DL = drive ID
  678. Return: AH = disk type
  679.             0 = disk not there
  680.             1 = floppy, no change detection present
  681.             2 = floppy with change detection
  682.             3 = fixed disk
  683.                CX:DX = number of 512-byte sectors
  684. -----------------------------------------------------------
  685. INT 13 - CHANGE OF DISK STATUS (PC/AT ONLY)
  686.         AH = 16h
  687.         DL = drive to check
  688. Return: AH = disk change status
  689.             0 = no disk change
  690.             6 = disk changed
  691. -----------------------------------------------------------
  692. INT 13 - SET DISK TYPE (PC/AT ONLY)
  693.         AH = 17h
  694.         AL = disk type
  695.             00 = no disk
  696.             01 = regular disk in regular drive
  697.             02 = regular disk in high-capacity drive
  698.             03 = high-capacity disk in high-capacity drive
  699.         DL = drive ID
  700. -----------------------------------------------------------
  701. INT 13 - SET MEDIA TYPE FOR FORMAT (PORTABLE? CONVERTIBLE? XT286?)
  702.         AH = 18h
  703.         DL = drive number
  704.         CH = lower 8 bits of number of tracks
  705.         CL = sectors per track (bits 0-5)
  706.              top 2 bits of number of tracks (bits 6,7)
  707. Return: AH = 00h  requested combination supported
  708.              01h  function not available
  709.              0Ch  not supported or druve type unknown
  710.              80h  there is no disk in the drive
  711.         ES:DI = pointer to 11-byte parameter table
  712. -----------------------------------------------------------
  713. INT 13 - PARK FIXED DISK HEADS (XT MODEL 286 ONLY)
  714.         AH = 19h
  715. -----------------------------------------------------------
  716. INT 14 - SERIAL I/O - INITIALIZE USART
  717.         AH = 0
  718.         AL = initializing parameters
  719.             7 - 6 - 5      4 - 3     2    1 - 0
  720.             -BAUD RATE-    PARITY   STOP   WORD
  721.                                     BITS  LENGTH
  722.             000  110 BD    00 none  0-1   10 - 7
  723.             001  150 BD    01 odd   1-2   11 - 8
  724.             010  300 BD    11 even
  725.             011  600 BD
  726.             100 1200 BD
  727.             101 2400 BD
  728.             110 4800 BD
  729.             111 9600 BD (4800 ON PCjr)
  730.         DX = port number
  731. Return: AX port status--see below
  732. -----------------------------------------------------------
  733. INT 14 - SERIAL I/O - TRANSMIT CHARACTER
  734.         AH = 1
  735.         AL = character
  736.         DX = port number
  737. Return: AH = RS-232 status code bits
  738.             0: data ready
  739.             1: overrun error
  740.             2: parity error
  741.             3: framing error
  742.             4: break detected
  743.             5: transmission buffer register empty
  744.             6: transmission shift register empty
  745.             7: time out--if set, other bits invalid
  746.         AL = modem status bits
  747.             0: delta Clear-To-Send
  748.             1: delta Data-Set-Ready
  749.             2: trailing edge of ring detected
  750.             3: change, receive line signal detected
  751.             4: Clear-To-Send
  752.             5: Data-Set-Ready
  753.             6: ring detected
  754.             7: receive line signal detected
  755. -----------------------------------------------------------
  756. INT 14 - SERIAL I/O - RECEIVE CHARACTER
  757.         AH = 2
  758. Return: AL = character received
  759.         AH = RS-232 status code (see above)
  760. -----------------------------------------------------------
  761. INT 14 - SERIAL I/O - GET USART STATUS
  762.         AH = 3
  763. Return: AH = RS-232 status code (see above)
  764.         AL = modem status code (see above)
  765. -----------------------------------------------------------
  766. INT 14 - EXTENDED INITIALIZE (CONVERTIBLE?)
  767.         AH = 4
  768.         AL = break status
  769.             0 if break
  770.             1 if no break
  771.         BH = parity
  772.             0 no parity
  773.             1 odd parity
  774.             2 even parity
  775.             3 stick parity odd
  776.             4 stick parity even
  777.         BL = number of stop bits
  778.             0: one stop bit
  779.             1: two stop bits (1.5 if 5 bit word length)
  780.         CH = word length
  781.             0: 5 bits
  782.             1: 6 bits
  783.             2: 7 bits
  784.             3: 8 bits
  785.         CL = baud rate
  786.             0: 110
  787.             1: 150
  788.             2: 300
  789.             3: 600
  790.             4: 1200
  791.             5: 2400
  792.             6: 4800
  793.             7: 9600
  794.             8: 19200
  795. Return: AL = modem status (see above)
  796.         AH = line control status (see above)
  797. -----------------------------------------------------------
  798. INT 14 - EXTENDD COMMUNICATION PORT CONTROL (CONVERTIBLE?)
  799.         AH = 5
  800.         AL = 0 read modem control register
  801.               Return: BL = modem control register (see below)
  802.                       AH = status
  803.         AL = 1 write modem control register
  804.               BL = modem control register
  805.                   bit 0: data terminal ready
  806.                   bit 1: request to send
  807.                   bit 2: OUT1
  808.                   bit 3: OUT2
  809.                   bit 4: LOOP
  810.                   bits 5-7 reserved
  811.               Return: AH = status
  812. -----------------------------------------------------------
  813. INT 15 - TURN ON CASSETTE MOTOR
  814.         AH = 0
  815. -----------------------------------------------------------
  816. INT 15 - TURN OFF CASSETTE MOTOR
  817.         AH = 1
  818. -----------------------------------------------------------
  819. INT 15 - READ DATA BLOCKS FROM CASSETTE
  820.         AH = 2
  821.         CX = count of bytes
  822.         ES:BX = pointer to data area
  823. Return: CF set on error
  824.         DX = count of bytes read
  825.         ES:BX = pointer past last byte read
  826. -----------------------------------------------------------
  827. INT 15 - WRITE DATA BLOCKS TO CASSETTE
  828.         AH = 3
  829.         CX = count of bytes to write
  830.         ES:BX = pointer to data area
  831. Return: ES:BX = pointer past last byte written
  832. -----------------------------------------------------------
  833. INT 15 - DESQview/TopView/TaskView - Give up CPU time
  834.         AX = 1000h
  835. Return: after other process(es) run
  836. -----------------------------------------------------------
  837. INT 15 - DESQview/TopView/TaskView - Get Version
  838.         AX = 1022h
  839.         BX = 0
  840. Return: BX nonzero, TopView or compat loaded
  841.            TaskView returns BX = 0001h
  842. -----------------------------------------------------------
  843. INT 15 - DESQview/TopView/TaskView commands
  844.         AH = 11h
  845.         AL = various
  846. -----------------------------------------------------------
  847. INT 15 - DESQview/TopView/TaskView commands
  848.         AH = 12h
  849.         AL = various
  850. -----------------------------------------------------------
  851. INT 15 - PRINT.COM - Internal
  852.         AH = 20h
  853.         AL = subfunction
  854.             00h ???
  855.             01h ???
  856. Note: sets or resets some flags which affect what PRINT does when it tries
  857. to access the disk
  858. -----------------------------------------------------------
  859. INT 15 - READ/MODIFY PROFILES (CONVERTIBLE ONLY)
  860.         AH = 40h
  861.         AL = subfunction
  862.             0: get system profile in CX and BX
  863.             1: set system profile from CX and BX
  864.             2: get internal modem profile in BX
  865.             3: set internal modem profile from BX
  866. -----------------------------------------------------------
  867. INT 15 - WAIT ON EXTERNAL EVENT (CONVERTIBLE ONLY)
  868.         AH = 41h
  869.         AL = condition type
  870.             bits 0-2: condition to wait for
  871.                       0 = any external event
  872.                       1 = compare and return if equal
  873.                       2 = compare and return if not equal
  874.                       3 = test and return if not zero
  875.                       4 = test and return if zero
  876.             bit 3:    reserved
  877.             bit 4:    1=port address, 0=user byte
  878.             bits 5-7: reserved
  879.         BH = condition compare or mask value
  880.         BL = timeout value times 55 milliseconds
  881.             0 means no timeout
  882.         DX = I/O port address if AL bit 4 set
  883.         ES:DI = pointer to user byte if AL bit 4 clear
  884. -----------------------------------------------------------
  885. INT 15 - REQUEST SYSTEM POWER OFF (CONVERTIBLE ONLY)
  886.         AH = 42h
  887.         AL = 0 to use system profile
  888.              1 to foce suspend regardless of system profile
  889. -----------------------------------------------------------
  890. INT 15 - READ SYSTEM STATUS (CONVERTIBLE ONLY)
  891.         AH = 43h
  892. Return: AL = status bits
  893.             bit 0: LCD detached
  894.             bit 1: reserved
  895.             bit 2: RS232/parallel adapter powered on
  896.             bit 3: internal modem powered on
  897.             bit 4: power activated by alarm
  898.             bit 5: standby power lost
  899.             bit 6: extern apower in use
  900.             bit 7: power low
  901. -----------------------------------------------------------
  902. INT 15 - (DE)ACTIVATE INTERNAL MODEM POWER (CONVERTIBLE ONLY)
  903.         AH = 44h
  904.         AL = 0 to power off
  905.              1 to power on
  906. -----------------------------------------------------------
  907. INT 15 - KEYBOARD INTERCEPT (CONVERTIBLE ONLY)
  908.         AH = 4Fh
  909.         AL = scan code
  910.         CF set
  911. Return: AL = scan code
  912.         CF set
  913. (Called by INT 9 handler to translate scan codes)
  914. -----------------------------------------------------------
  915. INT 15 - DEVICE OPEN (PC/AT ONLY)
  916.         AH = 80h
  917.         BX = device ID
  918.         CX = process type
  919. -----------------------------------------------------------
  920. INT 15 - DEVICE CLOSE (PC/AT ONLY)
  921.         AH = 81h
  922.         BX = device ID
  923.         CX = process type
  924. -----------------------------------------------------------
  925. INT 15 - DEVICE PROGRAM TERMINATE (PC/AT ONLY)
  926.         AH = 82h
  927.         BX = device ID
  928. -----------------------------------------------------------
  929. INT 15 - EVENT WAIT (PC/AT ONLY)
  930.         AH = 83h
  931.         AL = SUBSERVICE
  932.             0 = set interval
  933.             1 = cancel
  934.         ES:BX = pointer to event flag (bit 7 set when interval expires)
  935.         CX,DX = number of microseconds to wait (only accurate to 977 us)
  936. Return: CF set if function already busy
  937. -----------------------------------------------------------
  938. INT 15 - READ JOYSTICK SWITCH SETTINGS (PC/AT ONLY)
  939.         AH = 84h
  940.         DX = 0
  941. Return: AL = switch settings (bits 7-4)
  942. -----------------------------------------------------------
  943. INT 15 - READ JOYSTICK INPUTS (PC/AT ONLY)
  944.         AH = 84h
  945.         DX = 1
  946. Return: AX = A(x) value
  947.         BX = A(y) value
  948.         CX = B(x) value
  949.         DX = B(y) value
  950. -----------------------------------------------------------
  951. INT 15 - SYSTEM REQUEST KEY PRESS (PC/AT ONLY)
  952.         AH = 85h  (called by keyboard decode routine)
  953. Return: AL = 00 press
  954.         AL = 01 release
  955. -----------------------------------------------------------
  956. INT 15 - WAIT (PC/AT AND AFTER)
  957.         AH = 86h
  958.         CX,DX = number of microseconds to wait (only accurate to 977 us)
  959. -----------------------------------------------------------
  960. INT 15 - EXTENDED MEMORY - BLOCK MOVE   (286/386 machines only)
  961.         AH = 87h
  962.         CX = number of words to move
  963.         ES:SI = pointer to global descriptor table
  964.                offset 0h  null descriptor
  965.                       8h  uninitialized, will be made into GDT descriptor
  966.                      10h  descriptor for source of move
  967.                      18h  descriptor for destination of move
  968.                      20h  uninitialized, used by BIOS
  969.                      28h  uninitialized, will be made into SS descriptor
  970. -----------------------------------------------------------
  971. INT 15 - EXTENDED MEMORY - GET MEMORY SIZE  (286/386 machines only)
  972.         AH = 88h
  973. Return: AX = memory size
  974. -----------------------------------------------------------
  975. INT 15 - SWITCH TO VIRTUAL MODE (PC/AT ONLY)
  976.         AH = 89h
  977.         BL = interrupt number of IRQ0 (IRQ1-7 use next 7 interrupts)
  978.         BH = interrupt number of IRQ8 (IRQ9-F use next 7 interrupts)
  979.         DS:SI = pointer to GDT for protected mode
  980.                offset 0h  null descriptor
  981.                       8h  GDT descriptor
  982.                      10h  IDT descriptor
  983.                      18h  DS
  984.                      20h  ES
  985.                      28h  SS
  986.                      30h  CS
  987.                      38h  uninitialized, used to build descriptor for BIOS CS
  988.         CX = offset into protected-mode CS to jump to
  989. Return: CF set on error
  990.            AH = 0FFh  error enabling address line 20
  991. -----------------------------------------------------------
  992. INT 15 - DEVICE BUSY LOOP (PC/AT ONLY)
  993.         AH = 90h
  994.         AL = TYPE CODE
  995.             00h: disk
  996.             01h: diskette
  997.             02h: keybaord
  998.             80h: network (ES:BX = NCB)
  999.             FCh: disk reset
  1000.             FDh: diskette motor start
  1001.             FEh: printer
  1002. Return: CF set if wait time satisfied
  1003. -----------------------------------------------------------
  1004. INT 15 - SET FLAG AND COMPLETE INTERRUPT
  1005.         AH = 91h
  1006.         AL = type code, see AH=90h above
  1007. -----------------------------------------------------------
  1008. INT 15 - GET SYSTEM CONFIGURATION (XT after 1/10/86, PC Conv, XT286, PS/2)
  1009.         AH = C0h
  1010. Return: CF = 1 if BIOS doesn't support call
  1011.         ES:BX pointer to ROM table
  1012.              byte_count  dw   ?   ; number of bytes following
  1013.              model       db   ?   ; PC=ff, XT=fe or fb, PCjr = fd, etc, etc
  1014.              submodel    db   ?   ; distingushes between AT and XT/286, etc.
  1015.              BIOS_rev    db   ?   ; 0 for first release, 1 for 2nd, etc.
  1016.              featbyte    db   ?   ; 80h = DMA channel 3 used by hd BIOS
  1017.                                   ; 40h = 2nd 8259 installed
  1018.                                   ; 20h = Real-Time Clock installed
  1019.                                   ; 10h = INT 15h called upon INT 9h
  1020.                                   ;  8h = wait for external event supported
  1021.                                   ;  4h = extended BIOS area allocated at 640K
  1022.                                   ;  2h = bus is Micro Channel instead of PC
  1023.                                   ;  1h   reserved
  1024. -----------------------------------------------------------
  1025. INT 15 - DESQview ? - ???
  1026.         AH = C2h
  1027.         AL = subfunction
  1028.             00h ???
  1029.                BH = ???
  1030.             01h set something to default values
  1031.             02h ???
  1032.                BH = ???
  1033.             03h ???
  1034.                BH = ???
  1035.             04h points to RET instruction
  1036.             05h same as 01h, but also takes input value in BH
  1037.                BH = ???
  1038.             06h ???
  1039.                BH = 01h or 02h stored, otherwise ignored
  1040.             07h ???
  1041.                ES:BX = pointer to ???
  1042.                Return: AL = 00h
  1043. Note: the values in BH for those functions that take it as input are stored
  1044.       in different locations for each subfunction
  1045. -----------------------------------------------------------
  1046. INT 15 - DESQview (TopView?) - ???
  1047.         AH = 0DEh
  1048. -----------------------------------------------------------
  1049. INT 16 - KEYBOARD I/O - READ CHAR FROM BUFFER - WAIT IF EMPTY
  1050.         AH = 0
  1051. Return: AH = scan code
  1052.         AL = character
  1053. -----------------------------------------------------------
  1054. INT 16 - KEYBOARD I/O - CHECK BUFFER - DO NOT CLEAR
  1055.         AH = 1
  1056. Return: ZF = 0 character in buffer
  1057.             AH = scan code
  1058.             AL = character
  1059.         ZF = 1 no character in buffer
  1060. -----------------------------------------------------------
  1061. INT 16 - KEYBOARD I/O - GET SHIFT STATUS
  1062.         AH = 2
  1063.         AL = shift status bits
  1064.             0 = right shift key depressed
  1065.             1 = left shift key depressed
  1066.             2 = CTRL depressed
  1067.             3 = ALT depressed
  1068.             4 = SCROLL LOCK active
  1069.             5 = NUM LOCK active
  1070.             6 = CAPS LOCK active
  1071.             7 = INSERT state active
  1072. -----------------------------------------------------------
  1073. INT 16 - KEYBOARD I/O - SET DELAYS (PCjr, AT, PS/2)
  1074.         AH = 3
  1075.         AL = 0: reset typematic (PCjr)
  1076.         AL = 1: increase initial delay (PCjr)
  1077.         AL = 2: increase continuing delay (PCjr)
  1078.         AL = 3: increase both delays (PCjr)
  1079.         AL = 4: turn off typematic (PCjr)
  1080.         AL = 5: Set typematic rate (AT or PS/2)
  1081.           BH = 00 - 03 for delays of 250ms, 500ms, 750ms, or 1s
  1082.           BL = 00 - 1F for typematic rates of 30cps down to 2cps
  1083. -----------------------------------------------------------
  1084. INT 16 - KEYBOARD I/O - KEYCLICK (PCjr ONLY)
  1085.         AH = 4
  1086.         AL = 0: click off
  1087.         AL = 1: click on
  1088. -----------------------------------------------------------
  1089. INT 16 - KEYBOARD - Write to keyboard buffer (AT or PS/2 with enhanced kbd)
  1090.         AH = 5
  1091.         CH = scan code
  1092.         CL = character
  1093. Return: AL = 1 if buffer full
  1094. -----------------------------------------------------------
  1095. INT 16 - KEYBOARD - Get enhanced keystroke (AT or PS/2 with enhanced kbd)
  1096.         AH = 10h
  1097. Return: AH = scan code
  1098.         AL = character
  1099. -----------------------------------------------------------
  1100. INT 16 - KEYBOARD - Check enhanced keystroke (AT or PS/2 with enhanced kbd)
  1101.         AH = 11h
  1102. Return: ZF = 0 if keystroke available
  1103.             AH = scan code \ meaningless if ZF = 1
  1104.             AL = character /
  1105.         ZF = 1 if kbd buffer empty
  1106. -----------------------------------------------------------
  1107. INT 16 - KEYBOARD - Get enhanced shift flags (AT or PS/2 with enhanced kbd)
  1108.         AH = 12h
  1109. Return: AL (same as for AH=02)
  1110.            bit 7: Ins ON
  1111.            bit 6: CapsLock ON
  1112.            bit 5: NumLock ON
  1113.            bit 4: ScrollLock ON
  1114.            bit 3: Either ALT key down
  1115.            bit 2: Either CTRL key down
  1116.            bit 1: Left shift key down
  1117.            bit 0: Right shift key down
  1118.         AH
  1119.            bit 7: SysReq key down
  1120.            bit 6: CapsLock key down
  1121.            bit 5: NumLock key down
  1122.            bit 4: ScrollLock key down
  1123.            bit 3: Right Alt key down
  1124.            bit 2: Right Ctrl key down
  1125.            bit 1: Left Alt key down
  1126.            bit 0: Right Alt key down
  1127. -----------------------------------------------------------
  1128. INT 17 - OUTPUT CHARACTER TO PRINTER
  1129.         AH = 0
  1130.         AL = character
  1131. Return: AH = status bits
  1132.             0 = time out
  1133.             1 = unused
  1134.             2 = unused
  1135.             3 = I/O error
  1136.             4 = selected
  1137.             5 = out of paper
  1138.             6 = acknowledge
  1139.             7 = not busy
  1140. -----------------------------------------------------------
  1141. INT 17 - INITIALIZE PRINTER
  1142.         AH = 1
  1143. Return: AH = status (see above)
  1144. -----------------------------------------------------------
  1145. INT 17 - STATUS OF PRINTER
  1146.         AH = 2
  1147. Return: AH = status (see above)
  1148. -----------------------------------------------------------
  1149. INT 18 - TRANSFER TO ROM BASIC
  1150.    causes transfer to ROM-bases BASIC (IBM-PC)
  1151.    often reboots a compatible; often has no effect at all
  1152. -----------------------------------------------------------
  1153. INT 19 - DISK BOOT
  1154.    causes reboot of disk system (no memory test performed)
  1155. -----------------------------------------------------------
  1156. INT 1A - GET TIME OF DAY
  1157.         AH = 0
  1158. Return: CX = high (most signif.) portion of clock count
  1159.         DX = low (least signif.) portion of clock count
  1160.         AL = 0 if clock was read or written (via AH=0,1)
  1161.                within the current 24-hour period
  1162.                Otherwise, AL > 0
  1163. -----------------------------------------------------------
  1164. INT 1A - SET TIME OF DAY
  1165.         AH = 1
  1166.         CX = high (most signif.) portion of clock count
  1167.         DX = low (least signif.) portion of clock count
  1168. -----------------------------------------------------------
  1169. INT 1A - READ REAL TIME CLOCK (PC/AT ONLY)
  1170.         AH = 2
  1171. Return: CH = hours
  1172.         CL = minutes
  1173.         DH = seconds
  1174. -----------------------------------------------------------
  1175. INT 1A - SET REAL TIME CLOCK (PC/AT ONLY)
  1176.         AH = 3
  1177.         CH = hours
  1178.         CL = minutes
  1179.         DH = seconds
  1180.         DL = 1, if daylight savings; 0 if standard time
  1181. -----------------------------------------------------------
  1182. INT 1A - READ DATE FROM REAL TIME CLOCK (PC/AT ONLY)
  1183.         AH = 4
  1184. Return: DL = day
  1185.         DH = month
  1186.         CL = year
  1187.         CH = century (19 or 20)
  1188. -----------------------------------------------------------
  1189. INT 1A - SET DATE IN REAL TIME CLOCK (PC/AT ONLY)
  1190.         AH = 5
  1191.         DL = day
  1192.         DH = month
  1193.         CL = year
  1194.         CH = century (19 or 20)
  1195. -----------------------------------------------------------
  1196. INT 1A - SET ALARM (PC/AT ONLY)
  1197.         AH = 6
  1198.         CH = hours
  1199.         CL = minutes
  1200.         DH = seconds
  1201. Return: CF set if alarm already set or clock inoperable
  1202.         INT 4Ah will be called when alarm goes off
  1203. -----------------------------------------------------------
  1204. INT 1A - RESET ALARM (PC/AT ONLY)
  1205.         AH = 7
  1206. -----------------------------------------------------------
  1207. INT 1A - SET RTC ACTIVATED POWER ON MODE (CONVERTIBLE ONLY)
  1208.         AH = 8
  1209.         CH = hours in BCD
  1210.         CL = minutes in BCD
  1211.         DH = seconds in BCD
  1212. -----------------------------------------------------------
  1213. INT 1A - READ RTC ALARM TIME AND STATUS (CONVERTIBLE ONLY)
  1214.         AH = 9
  1215. Return: CH = hours in BCD
  1216.         CL = minutes in BCD
  1217.         DH = seconds in BCD
  1218.         DL = alarm status
  1219.             0  alarm not enabled
  1220.             1  alarm enabled but will not power up system
  1221.             2  alarm will power up system
  1222. -----------------------------------------------------------
  1223. INT 1A - SET UP SOUND MULTIPLEXOR (PCjr ONLY)
  1224.         AH = 80h
  1225.         AL = 0 source is 8253 channel 2
  1226.              1 source is cassette input
  1227.              2 source is I/O channle "Audio IN"
  1228.              3 source is sound generator chip
  1229. -----------------------------------------------------------
  1230. INT 1B - CTRL-BREAK KEY
  1231.    This interrupt is called when the keyboard scanner of the IBM
  1232.    machines detects CTRL and BREAK pressed at the same time. It
  1233.    normally points to a short routine in DOS which sets the
  1234.    Ctrl-C flag, thus invoking INT 23h the next time DOS checks
  1235.    for Ctrl-C.
  1236. -----------------------------------------------------------
  1237. INT 1C - CLOCK TICK
  1238.    This interrupt is called (in the IBM) at the end of each time-update
  1239.    operation by the real-time clock routines. It normally points to an
  1240.    IRET.
  1241. -----------------------------------------------------------
  1242. INT 1D -> 6845 Video Init tables
  1243.         table for modes 0 and 1   \
  1244.         table for modes 2 and 3    \ each table is 16 bytes long and
  1245.         table for modes 4,5, and 6 / contains values for 6845 registers
  1246.         table for mode 7          /
  1247.         4 words -- size of video RAM for modes 0/1, 2/3, 4/5, and 6/7
  1248.         8 bytes -- number of columns in each mode
  1249.         8 bytes -- video controller mode byte for each mode
  1250. -----------------------------------------------------------
  1251. INT 1E -> Diskette Params (BASE TABLE)
  1252. Default at f000:efc7
  1253.         db      step rate & head unload times
  1254.         db      head load time & DMA
  1255.         db      motor off time
  1256.         db      sector size (0->128, 1->256, 2->512, 3->1024)
  1257.         db      last sector number (8 or 9 typical)
  1258.         db      inter-sector gap size on read/write (42 typical)
  1259.         db      data transfer length (255 typical)
  1260.         db      inter-sector gap size on format (80 typical)
  1261.         db      sector fill on format (f6 typical)
  1262.         db      head-settle time ms (typical 25, 2.10->15)
  1263.         db      motor start-up time (1/8 secs) (typical 4, 2.10->2)
  1264. -----------------------------------------------------------
  1265. INT 1F -> Pointer to Graphics Set 2--contains bitmaps for high 128 chars
  1266. -----------------------------------------------------------
  1267. INT 20 - Minix - SEND/RECEIVE MESSAGE
  1268.         AX = process ID of other process
  1269.         BX = pointer to message
  1270.         CX = 1 send
  1271.              2 receive
  1272.              3 send&receive
  1273. Note: the message contains the system call number (numbered as in V7 Unix(tm))
  1274.       and the call parameters
  1275. -----------------------------------------------------------
  1276. INT 20 - DOS - PROGRAM TERMINATION
  1277. returns to DOS
  1278. -----------------------------------------------------------
  1279. INT 21 - PROGRAM TERMINATION
  1280.         AH = 00h
  1281. Same action as INT 20; returns to DOS.
  1282. -----------------------------------------------------------
  1283. INT 21 - KEYBOARD INPUT
  1284.         AH = 01h
  1285. Return: AL = character read
  1286. -----------------------------------------------------------
  1287. INT 21 - DISPLAY OUTPUT
  1288.         AH = 02h
  1289.         DL = character
  1290. -----------------------------------------------------------
  1291. INT 21 - AUX Input
  1292.         AH = 03h
  1293. Return: AL = character read
  1294. -----------------------------------------------------------
  1295. INT 21 - AUX Output
  1296.         AH = 04h
  1297.         DL = character to send
  1298. -----------------------------------------------------------
  1299. INT 21 - PRINTER OUTPUT
  1300.         AH = 05h
  1301.         DL = character to print
  1302. -----------------------------------------------------------
  1303. INT 21 - DIRECT CONSOLE I/O - CHARACTER OUTPUT
  1304.         AH = 06h
  1305.         DL = character <> FFh
  1306. -----------------------------------------------------------
  1307. INT 21 - DIRECT CONSOLE I/O - CHARACTER INPUT
  1308.         AH = 06h
  1309.         DL = 0FFh
  1310. Return: ZF set   = no character
  1311.         ZF clear = character recieved
  1312.                   AL = character
  1313. Note: Character is echoed to STDOUT if received.
  1314. -----------------------------------------------------------
  1315. INT 21 - Direct STDIN Input, no echo
  1316.         Reg AH = 07h
  1317. Note: same as Function 6 for input but char not echoed
  1318. -----------------------------------------------------------
  1319. INT 21 - KEYBOARD INPUT - NO ECHO
  1320.         AH = 08h
  1321. Return: AL = character
  1322. -----------------------------------------------------------
  1323. INT 21 - PRINT STRING
  1324.         AH = 09h
  1325.         DS:DX = address of string terminated by "$"
  1326. -----------------------------------------------------------
  1327. INT 21 - BUFFERED KEYBOARD INPUT
  1328.         AH = 0Ah
  1329.         DS:DX = address of buffer
  1330. Note: first byte of buffer must contain maximum length
  1331.       on return the second byte contains actual length, third and
  1332.         subsequent bytes contain the input line
  1333. -----------------------------------------------------------
  1334. INT 21 - CHECK STANDARD INPUT STATUS
  1335.         AH = 0Bh
  1336. Return: AL = FFh if character available
  1337.              00h if no character
  1338. -----------------------------------------------------------
  1339. INT 21 - Clear Keyboard Buffer
  1340.         AH = 0Ch
  1341.         AL must be 1, 6, 7, 8, or 0Ah.
  1342.   Flushes all typeahead input, then executes function specified
  1343. by AL (by moving it to AH and repeating the INT 21 call).
  1344.   If AL contains a value not in the list above, the keyboard buffer is
  1345. flushed and no other action is taken.
  1346. -----------------------------------------------------------
  1347. INT 21 - Disk Reset
  1348.         AH = 0Dh
  1349. Flushes all disk buffers.
  1350. -----------------------------------------------------------
  1351. INT 21 - SELECT DISK
  1352.         AH = 0Eh
  1353.         DL = new default drive number (0 = A, 1 = B, etc.)
  1354. Return: AL = number of logical drives
  1355. -----------------------------------------------------------
  1356. INT 21 - OPEN DISK FILE
  1357.         AH = 0Fh
  1358.         DS:DX = address of FCB
  1359. Return: AL = 00h file found
  1360.              FFh file not found
  1361. -----------------------------------------------------------
  1362. INT 21 - CLOSE DISK FILE
  1363.         AH = 10h
  1364.         DS:DX = address of FCB
  1365. Return: AL = 00h directory update successful
  1366.              FFh file not found in directory
  1367. -----------------------------------------------------------
  1368. INT 21 - Search First using FCB
  1369.         AH = 11h
  1370.         DS:DX = address of FCB
  1371. Return: AL =
  1372.             00h = file found
  1373.             FFh = file not found
  1374. If file found, FCB is created at DTA address and
  1375. set up to OPEN or DELETE it.
  1376. -----------------------------------------------------------
  1377. INT 21 - Search Next using FCB
  1378.         AH = 12h
  1379.         DS:DX = address of FCB
  1380. Return: AL =
  1381.             00h = file found
  1382.             FFh = file not found
  1383. If file found, FCB is created at DTA address and
  1384. set up to OPEN or DELETE it.
  1385. -----------------------------------------------------------
  1386. INT 21 - Delete File via FCB
  1387.         AH = 13h
  1388.         DS:DX = address of FCB
  1389. Return: AL =
  1390.             00h = file found
  1391.             FFh = file not found
  1392. -----------------------------------------------------------
  1393. INT 21 - SEQUENTIAL DISK FILE READ
  1394.         AH = 14h
  1395.         DS:DX = address of FCB
  1396. Return: AL =
  1397.             0 = successful read
  1398.             1 = end of file
  1399.             2 = data transfer area too small
  1400.             3 = partial record, EOF
  1401. -----------------------------------------------------------
  1402. INT 21 - SEQUENTIAL DISK RECORD WRITE
  1403.         AH = 15h
  1404.         DS:DX = address of FCB
  1405. Return: AL =
  1406.             0 = successful write
  1407.             1 = disk full
  1408.             2 = data transfer area too small
  1409. -----------------------------------------------------------
  1410. INT 21 - CREATE A DISK FILE
  1411.         AH = 16h
  1412.         DS:DX = address of FCB
  1413. Return: AL =
  1414.             00h = successful creation
  1415.             FFh = directory full
  1416. -----------------------------------------------------------
  1417. INT 21 - Rename File via FCB
  1418.         AH = 17h
  1419.         DS:DX = address of FCB
  1420.         FCB contains new name starting at byte 17h.
  1421. Return: AL =
  1422.             00h = file found
  1423.             FFh = file not found
  1424. -----------------------------------------------------------
  1425. INT 21 - Internal - does nothing
  1426.         AH = 18h
  1427. Return: AL = 0
  1428. -----------------------------------------------------------
  1429. INT 21 - Default Disk Number
  1430.         AH = 19h
  1431. Return: AL = current drive number (letter - 'A')
  1432. -----------------------------------------------------------
  1433. INT 21 - SET DISK TRANSFER AREA ADDRESS
  1434.         AH = 1Ah
  1435.         DS:DX = address of buffer
  1436. -----------------------------------------------------------
  1437. INT 21 - Default Drive Disk Size
  1438.         AH = 1Bh
  1439. Return: DS:BX points to FAT ID byte
  1440.         DX = number of allocation units on disk
  1441.         AL = number of sectors per allocation unit (cluster)
  1442.         CX = number of bytes per sector
  1443. -----------------------------------------------------------
  1444. INT 21 - Specific Drive's Disk Size
  1445.         AH = 1Ch
  1446.         DL = Drive Number to check
  1447. Return: DS:BX points to FAT ID byte
  1448.         DX = number of allocation units on disk
  1449.         AL = number of sectors per allocation unit (cluster)
  1450.         CX = number of bytes per sector
  1451. -----------------------------------------------------------
  1452. INT 21 - Internal - does nothing
  1453.         AH = 1Dh
  1454. Return: AL = 0
  1455. -----------------------------------------------------------
  1456. INT 21 - Internal - does nothing
  1457.         AH = 1Eh
  1458. Return: AL = 0
  1459. -----------------------------------------------------------
  1460. INT 21 - Internal - GET DEFAULT DRIVE PARAMETER BLOCK
  1461.         AH = 1Fh
  1462. Return: AL = 00h No Error
  1463.              FFh Error
  1464.         (DS:BX) = ADDRESS OF DRIVE PARAMETER BLOCK.
  1465. Note: for DOS 2.x and 3.x, this just invokes function 32h with DL = 0
  1466. -----------------------------------------------------------
  1467. INT 21 - Internal - does nothing
  1468.         AH = 20h
  1469. Return: AL = 0
  1470. -----------------------------------------------------------
  1471. INT 21 - RANDOM DISK RECORD READ
  1472.         AH = 21h
  1473.         DS:DX = address of FCB
  1474. Return: AL =
  1475.             0 = successful read
  1476.             1 = end of file
  1477.             2 = data transfer area too small
  1478.             3 = partial record, EOF
  1479. -----------------------------------------------------------
  1480. INT 21 - Random Disk Write
  1481.         AH = 22h
  1482. Same setup as Random Read, but writes to disk
  1483. -----------------------------------------------------------
  1484. INT 21 - FILE SIZE
  1485.         AH = 23h
  1486.         DS:DX = address of FCB
  1487. Return: AL =
  1488.             00h = file found
  1489.             FFh = file not found
  1490. FCB SET TO NO. OF RECORDS
  1491. -----------------------------------------------------------
  1492. INT 21 - Set Random Record Field
  1493.         AH = 24h
  1494.         DS:DX = address of FCB
  1495. Return: Random Record Field of FCB is set to be same as Current Block
  1496.         and Current Record.
  1497. Note: FCB must be OPEN already
  1498. -----------------------------------------------------------
  1499. INT 21 - Set Interrupt Vector
  1500.         AH = 25h
  1501.         AL = interrupt number
  1502.         DS:DX = new vector to be used for specified interrupt
  1503. -----------------------------------------------------------
  1504. INT 21 - Create PSP
  1505.         AH = 26h
  1506.         DX = Segment number to set up PSP at
  1507. Current PSP is copied to specified segment
  1508. -----------------------------------------------------------
  1509. INT 21 - RANDOM BLOCK READ
  1510.         AH = 27h
  1511.         DS:DX = address of FCB
  1512.         CX = number of records to be read
  1513. Return: AL =
  1514.             0 = successful read
  1515.             1 = end of file
  1516.             2 = data transfer area too small
  1517.             3 = partial record, EOF
  1518. -----------------------------------------------------------
  1519. INT 21 - RANDOM BLOCK WRITE
  1520.         AH = 28h
  1521.         DS:DX = address of FCB
  1522.         CX = number of records to be written
  1523.              if zero, truncate file to current random file position
  1524. Return: AL =
  1525.             0 = successful write
  1526.             1 = disk full
  1527.             2 = data transfer area too small
  1528. -----------------------------------------------------------
  1529. INT 21 - Parse Filename
  1530.         AH = 29h
  1531.         DS:SI = pointer to string to parse
  1532.         ES:DI = pointer to memory to fill with unopened FCB
  1533.         AL = bit mask to control parsing
  1534.             0 = 0: parsing stops if file separator found
  1535.                 1: leading separator ignored
  1536.             1 = 0: drive number in FCB set to default drive if not present
  1537.                    in string
  1538.                 1: drive number in FCB not changed
  1539.             2 = 0: filename in FCB set to blanks if no filename in string
  1540.                 1: filename in FCB not changed if string does not contain
  1541.                    a filename
  1542.             3 = 0: extension in FCB set to blanks if no extension in string
  1543.                 1: extension left unchanged
  1544. Return: AL = 00: no wildcards in name or extension
  1545.              01: wildcards appeared
  1546.         DS:SI = pointer to first byte after parsed string
  1547.         ES:DI = unopened FCB
  1548. -----------------------------------------------------------
  1549. INT 21 - GET CURRENT DATE
  1550.         AH = 2Ah
  1551. Return: DL = day
  1552.         DH = month
  1553.         CX = year
  1554.         AL = day of the week (0=Sunday, 1=Monday, etc.)
  1555. -----------------------------------------------------------
  1556. INT 21 - Set CURRENT DATE
  1557.         AH = 2Bh
  1558.         DL = day
  1559.         DH = month
  1560.         CX = year
  1561. Return: AL = 0 if no error
  1562.         AL = 0FFh if bad value sent to routine
  1563.         (DOS 3.3 also sets CMOS clock)
  1564.         (DESQview also accepts CX = 4445h and DX = 5351h, i.e. 'DESQ' as valid)
  1565. -----------------------------------------------------------
  1566. INT 21 - GET CURRENT TIME
  1567.         AH = 2Ch
  1568. Return: CH = hours
  1569.         CL = minutes
  1570.         DH = seconds
  1571.         DL = hundredths of seconds
  1572. Note: time is updated approximately every 5/100 second
  1573. -----------------------------------------------------------
  1574. INT 21 - Set CURRENT TIME
  1575.         AH = 2Dh
  1576.         CH = hours
  1577.         CL = minutes
  1578.         DH = seconds
  1579.         DL = hundredths of seconds
  1580. Return: AL = 0 if no error
  1581.         AL = 0ffH if bad value sent to routine
  1582.         (DOS 3.3 also sets CMOS clock)
  1583. -----------------------------------------------------------
  1584. INT 21 - Set Verify Flag
  1585.         AH = 2Eh
  1586.         DL = 0
  1587.         AL = 1 if VERIFY on
  1588.         AL = 0 if VERIFY off
  1589. -----------------------------------------------------------
  1590. INT 21 - Get Disk Transfer Area Address
  1591.         AH = 2Fh
  1592. Return: ES:BX = address of DTA
  1593. -----------------------------------------------------------
  1594. INT 21 - Get DOS Version
  1595.         AH = 30h
  1596. Return: AL = Major Version number
  1597.         AH = Minor Version number
  1598.         BH = OEM number
  1599.         BL:CX = 24-bit user number
  1600. -----------------------------------------------------------
  1601. INT 21 - TERMINATE BUT STAY RESIDENT
  1602.         AH = 31h
  1603.         AL = exit code
  1604.         DX = program size, in paragraphs
  1605. -----------------------------------------------------------
  1606. INT 21 - Internal - GET DRIVE PARAMETER BLOCK
  1607.         AH = 32h
  1608.         DL = drive number
  1609.             0 = default, 1 = A, etc.
  1610. Return: AL = 0FFh if invalid drive number, else
  1611.         DS:BX = address of drive parameter block.
  1612.  
  1613.                 STRUCTURE OF DOS DRIVE PARAMETER BLOCK:
  1614.  
  1615. DPBLOCK         STRUCT          ;OFFSET
  1616. DISK_OFFSET     DB      ?       ;  0.  drive number (0 = A, etc.)
  1617. UNIT_OFFSET     DB      ?       ;  1.  unit number within device driver
  1618. SECTOR_SIZE     DW      ?       ;  2.  number of bytes per sector
  1619. MAX_CLUSTER     DB      ?       ;  4.  largest sector number in cluster
  1620.                                 ;      add one for number of sectors/cluster
  1621. LOG2_SECTORS    DB      ?       ;  5.  log base two of the cluster size
  1622. RESERVED        DW      ?       ;  6.  number of reserved (boot) sectors
  1623. FAT_COUNT       DB      ?       ;  8.  number of copies of the FAT
  1624. ROOT_COUNT      DW      ?       ;  9.  number of root directory entries
  1625. DATA_START      DW      ?       ; 11.  first data sector on medium
  1626. MAX_NUMBER      DW      ?       ; 13.  largest possible cluster number
  1627.                                 ;      subtract one for number of data clusters
  1628. FAT_SECTORS     DB      ?       ; 15.  number of sectors in one FAT copy
  1629. ROOT_START      DW      ?       ; 16.  first sector of root directory
  1630. DEVICE_ADDR     DD      ?       ; 18.  address of device driver for this drive
  1631. DESCRIPTOR      DB      ?       ; 22.  media descriptor byte for medium
  1632. VALID_BYTE      DB      ?       ; 23.  0FFh indicates block must be rebuilt
  1633. NEXT_BLOCK      DD      ?       ; 24.  address of next device block in list
  1634.  
  1635. ;       FROM THIS POINT ON, DOS 3 DIFFERS FROM 2:
  1636.  
  1637.                 IF      DOS2
  1638. DIR_START       DW      ?       ; 28.  starting cluster of current directory
  1639.                                 ;      zero indicates the root directory
  1640. PATH_NAME       DB      64 DUP (?)
  1641.                                 ; 30.  ASCIIZ current directory path string
  1642.                 ELSE    DOS3
  1643. ;               on my XT, this was always:
  1644.                 DW      0
  1645.                 DW      0FFFFh
  1646.                 ENDIF
  1647. DPBLOCK         ENDS
  1648. -----------------------------------------------------------
  1649. INT 21 - Get or Set CONTROL-BREAK
  1650.         AH = 33h
  1651.         AL = subfunction
  1652.             00h Get
  1653.             01h Put
  1654.                DL = 0 for OFF or 1 for ON
  1655.             02h internal, called by PRINT.COM (DOS 3.1)
  1656. Return: DL = current BREAK setting if AL = 00h
  1657.             0 BREAK=OFF
  1658.             1 BREAK=ON
  1659.         AL = FFh if error
  1660. -----------------------------------------------------------
  1661. INT 21 - Internal - Return CritSectFlag Pointer
  1662.         AH = 34h
  1663. Return: ES:BX points to DOS "Critical Section Flag"
  1664. Notes:
  1665.    When byte pointed to is zero, DOS is supposed to be
  1666.    safe to interrupt. NOT RELIABLE according to Chris Dunford.
  1667.  
  1668.    Examination of DOS 2.10 code in this area indicates that the
  1669.    byte immediately FOLLOWING this "Critical Section Flag" must
  1670.    be 00 to permit the PRINT.COM interrupt to be called.
  1671.  
  1672.    For DOS 3.0 and 3.1 (except COMPAQ DOS 3.0), the byte BEFORE
  1673.    the "Critical Section Flag" must be zero, and for COMPAQ DOS 3.0,
  1674.    the byte 01AAh before it must be zero.
  1675. -----------------------------------------------------------
  1676. INT 21 - Get Interrupt Vector
  1677.         AH = 35h
  1678.         AL = interrupt number
  1679. Return: ES:BX = value of interrupt vector
  1680. -----------------------------------------------------------
  1681. INT 21 - DISK SPACE
  1682.         AH = 36h
  1683.         DL = drive code (0 = default, 1 = A, 2 = B, etc.)
  1684. Return: AX = number of sectors per cluster
  1685.              or 0FFFFh if invalid drive
  1686.         BX = number of available clusters
  1687.         CX = bytes per sector
  1688.         DX = total clusters
  1689. Note: multiply AX x CX x BX for free space on disk
  1690.       multiply AX x CX x DX for total disk space
  1691. -----------------------------------------------------------
  1692. INT 21 - Internal - switchar/availdev
  1693.         AH = 37h
  1694.         AL = subfunction
  1695.            0 Read switch character (returns current character in DL)
  1696.            1 Set switch character (specify new character in DL)
  1697.            2 (DOS 2.x only) Read device availability (as set by function AL=3)
  1698.            3 (DOS 2.x only) Set device availability, where:
  1699.              DL = 0 means /DEV/ must preceed device names
  1700.              DL <> 0 means /DEV/ need not preceed device names
  1701. Return: DL = Switch character (if AL=0 or 1)
  1702.              Device availability flag (if AL=2 or 3)
  1703.         AL=0FFh means the value in AL was not in the range 0-3.
  1704. -----------------------------------------------------------
  1705. INT 21 - Get Country-Dependent Information
  1706.         AH = 38h
  1707.   DOS 2.x
  1708.         AL = 0  get current-country info
  1709.         DS:DX = segment:offset of buffer for returned info
  1710. Return: BX = country code
  1711.         buffer at DS:DX filled as follows:
  1712.            bytes 0-1 = date format   0 = USA    mm dd yy
  1713.                                      1 = Europe dd mm yy
  1714.                                      2 = Japan  yy mm dd
  1715.            byte 2    = currency symbol
  1716.            byte 3    = 00h
  1717.            byte 4    = thousands separator char
  1718.            byte 5    = 00h
  1719.            byte 6    = decimal separator char
  1720.            byte 7    = 00h
  1721.            bytes 8-1Fh reserved
  1722.  
  1723.   DOS 3.x
  1724.         AL = 0 for current country
  1725.         AL = 01h thru 0FEh for specific country with code <255
  1726.         AL = 0FFh for specific country with code >= 255
  1727.            BX = 16-bit country code
  1728.         DS:DX = segment:offset of buffer for returned info
  1729.         DX = 0FFFFh if setting country code, rather than getting info
  1730. Return: (if DX <> 0FFFFh)
  1731.         BX = country code
  1732.         DS:DX filled in:
  1733.               bytes 0-1 = date format (see above)
  1734.               bytes 2-6 = currency symbol string, ASCIZ
  1735.               byte 7    = thousands seaprator char
  1736.               byte 8    = 00h
  1737.               byte 9    = decimal separator char
  1738.               byte 0Ah  = 00h
  1739.               byte 0Bh  = date separator char
  1740.               byte 0Ch  = 00h
  1741.               byte 0Dh  = time separator char
  1742.               byte 0Eh  = 00h
  1743.               byte 0Fh  = currency format
  1744.                            bit 1 = number of spaces between value and curr sym
  1745.                            bit 0 = 0 if currency symbol precedes value
  1746.                                    1 if currency symbol follows value
  1747.               byte 10h  = number of digits after decimal in currency
  1748.               byte 11h  = time format
  1749.                            bit 0 = 0 if 12-hour clock
  1750.                                    1 if 24-hour clock
  1751.               bytes 12h-15h = address of case map routine (FAR CALL)
  1752.               byte 16h  = data-list separator char
  1753.               byte 17h  = 00h
  1754.               bytes 18h-21h reserved
  1755.       If error:
  1756.         CF set
  1757.         AX = error code
  1758. -----------------------------------------------------------
  1759. INT 21 - CREATE A SUBDIRECTORY (MKDIR)
  1760.         AH = 39h
  1761.         DS:DX = address of ASCIIZ pathname
  1762. Return: CF = 1 if error
  1763.             AX = Error Code
  1764. -----------------------------------------------------------
  1765. INT 21 - REMOVE A DIRECTORY ENTRY (RMDIR)
  1766.         AH = 3Ah
  1767.         DS:DX = address of ASCIIZ pathname
  1768. Return: CF = 1 if error
  1769.             AX = Error Code
  1770. -----------------------------------------------------------
  1771. INT 21 - CHANGE THE CURRENT DIRECTORY (CHDIR)
  1772.         AH = 3Bh
  1773.         DS:DX = address of ASCIIZ directory name
  1774. Return: CF = 1 if error
  1775.             AX = Error Code
  1776. -----------------------------------------------------------
  1777. INT 21 - CREATE A FILE WITH HANDLE (CREAT)
  1778.         AH = 3Ch
  1779.         CX = attributes for file
  1780.         DS:DX = address of ASCIZ filename
  1781. Return: CF = 1 if error
  1782.             AX = Error Code
  1783.         CF = 0 successful
  1784.             AX = file handle
  1785. -----------------------------------------------------------
  1786. INT 21 - OPEN DISK FILE WITH HANDLE
  1787.         AH = 3Dh
  1788.         AL = access code
  1789.             0 = Read Only
  1790.             1 = Write Only
  1791.             2 = Read/Write
  1792.         AL bits 7-3 = file-sharing modes (DOS 3.x)
  1793.             bit 7    = inheritance flag, set for no inheritance
  1794.             bits 4-6 = sharing mode
  1795.                       000 compatibility mode
  1796.                       001 exclusive (deny all)
  1797.                       010 write access denied (deny write)
  1798.                       011 read access denied (deny read)
  1799.                       100 full access permitted (deny none)
  1800.             bit 3    = reserved, should be zero
  1801.         DS:DX = address of ASCIZ filename
  1802.         DX = OFFSET ADDRESS OF ASCIIZ
  1803. Return: CF = 1 if error
  1804.             AX = Error Code
  1805.         CF = 0 successful
  1806.             AX = file handle
  1807. -----------------------------------------------------------
  1808. INT 21 - CLOSE A FILE WITH HANDLE
  1809.         AH = 3Eh
  1810.         BX = file handle
  1811. Return: CF = 1 if error
  1812.             AX = Error Code
  1813. -----------------------------------------------------------
  1814. INT 21 - READ FROM FILE WITH HANDLE
  1815.         AH = 3Fh
  1816.         BX = file handle
  1817.         CX = number of bytes to read
  1818.         DS:DX = address of buffer
  1819. Return: CF = 1 if error
  1820.             AX = Error Code
  1821.         CF = 0 successful
  1822.             AX = number of bytes read
  1823. -----------------------------------------------------------
  1824. INT 21 - WRITE TO FILE WITH HANDLE
  1825.         AH = 40h
  1826.         BX = file handle
  1827.         CX = number of bytes to write
  1828.         DS:DX = pointer to buffer
  1829. Return: CF = 1 if error
  1830.             AX = Error Code
  1831.         CF = 0 successful
  1832.             AX = number of bytes written
  1833. -----------------------------------------------------------
  1834. INT 21 - DELETE A FILE (UNLINK)
  1835.         AH = 41h
  1836.         DS:DX = pointer to ASCIIZ name of file to delete
  1837. Return: CF = 1 if error
  1838.             AX = Error Code
  1839. -----------------------------------------------------------
  1840. INT 21 - MOVE FILE READ/WRITE POINTER (LSEEK)
  1841.         AH = 42h
  1842.         AL = method value
  1843.             0 = offset from beginning of file
  1844.             1 = offset from present location
  1845.             2 = offset from end of file
  1846.         BX = file handle
  1847.         CX:DX = offset in bytes
  1848. Return: CF = 1 if error
  1849.             AX = Error Code
  1850.         CF = 0 successful
  1851.             DX:AX = new offset
  1852. -----------------------------------------------------------
  1853. INT 21 - GET/PUT FILE ATTRIBUTES (CHMOD)
  1854.         AH = 43h
  1855.         AL =
  1856.             0 = get file attributes
  1857.             1 = put file attributes
  1858.                CX = file attribute bits
  1859.                    0 = read only
  1860.                    1 = hidden file
  1861.                    2 = system file
  1862.                    3 = volume label
  1863.                    4 = subdirectory
  1864.                    5 = written since backup
  1865.         DX = pointer to ASCIIZ file name
  1866. Return: CF = 1 if error
  1867.             AX = Error Code if any
  1868.         CX = file attributes on get
  1869. -----------------------------------------------------------
  1870. INT 21 - IOCTL
  1871.         AH = 44h
  1872.         AL =
  1873.            0 = Get device information (DX)
  1874.            1 = Set device information (DL, DH = 0)
  1875.                DX BITS =
  1876.                  0 = console input device
  1877.                  1 = console output device
  1878.                  2 = null device
  1879.                  3 = clock device
  1880.                  5 = binary mode
  1881.                  6 = EOF
  1882.                  7 = device is character device if set
  1883.                      if not, EOF = 0 if channel has been written
  1884.                      bits 0-5 are block device number
  1885.                 12 = network device
  1886.                 14 = can process control strings (AL=2-5, can only be read)
  1887.                 15 reserved
  1888.            2 = Read CX bytes to DS:DX from BX control chan
  1889.            3 = Write CX bytes from DS:DX from BX control chan
  1890.            4 = as 2 but for drive BL
  1891.            5 = as 3 but for drive BL
  1892.                AX = number of bytes transfered
  1893.            6 = Get input status
  1894.            7 = Get output status
  1895.                AX = FFH for ready or 00h for not ready
  1896.            8 = Is block device BL changeable? (DOS 3)
  1897.                AX = 0 = yes
  1898.            9 = Is logical device BL local? (DOS 3)
  1899.                DX (attribute word) bit 12 (1000h) = 0 = yes
  1900.           10 = Is handle BX local? (DOS 3)
  1901.                DX (attribute word) bit 15 (8000h) = 0 = yes
  1902.           11 = Change sharing retry count to DX (def 3), (DOS 3.x)
  1903.                delay CX (def 1)
  1904.           12 = General IOCTL (DOS 3.3 [3.2?])
  1905.         BX = file handle (or BL = drive number w/0 = default)
  1906. Return: CF = 1 if error
  1907.             AX = Error Code
  1908. -----------------------------------------------------------
  1909. INT 21 - Create Duplicate Handle (DUP)
  1910.         AH = 45h
  1911.         BX = file handle to duplicate
  1912. Return: CF = 1 if error
  1913.             AX = Error Code
  1914.         CF = 0 successful
  1915.             AX = new file handle
  1916. -----------------------------------------------------------
  1917. INT 21 - Force Duplicate Handle (FORCDUP) (DUP2)
  1918.         AH = 46h
  1919.         BX = Existing file handle
  1920.         CX = new file handle
  1921. Return: CF = 1 if error
  1922.             AX = Error Code
  1923. -----------------------------------------------------------
  1924. INT 21 - Get Current Directory
  1925.         AH = 47h
  1926.         DL = drive (0=default, 1=A, etc.)
  1927.         DS:SI points to 64-byte buffer area
  1928. Return: CF = 1 if error
  1929.             AX = Error Code
  1930. -----------------------------------------------------------
  1931. INT 21 - Allocate Memory
  1932.         AH = 48h
  1933.         BX = number of 16-byte paragraphs desired
  1934. Return: CF = 1 if error
  1935.             AX = Error Code
  1936.             BX = Maximum available
  1937.         CF = 0 successful
  1938.             AX = segment of allocated memory block
  1939. -----------------------------------------------------------
  1940. INT 21 - Free Memory
  1941.         AH = 49h
  1942.         ES = Segment address of area to be freed
  1943. Return: CF = 1 if error
  1944.             AX = Error Code
  1945. -----------------------------------------------------------
  1946. INT 21 - Adjust Block Size (SETBLOCK)
  1947.         AH = 4Ah
  1948.         ES = Segment address of block to change
  1949.         BX = New size in paragraphs
  1950. Return: CF = 1 if error
  1951.             AX = Error Code
  1952.             BX = Maximum size possible for the block
  1953. -----------------------------------------------------------
  1954. INT 21 - Load or Execute (EXEC)
  1955.         AH = 4Bh
  1956.         AL = subfunction
  1957.             0 = load and execute program
  1958.             2 = load (Internal) but do not execute
  1959.             3 = load overlay; do not create PSP
  1960.         DS:DX = filename
  1961.         ES:BX = parameter block
  1962.                AL =
  1963.                 0 => word segment environment pointer
  1964.                      dword command line pointer
  1965.                      dword FCB 1
  1966.                      dword FCB 2
  1967.                 3 => word segment load address
  1968.                      word segment relocation factor
  1969. Return: CF = 1 if error
  1970.             AX = Error Code
  1971.  
  1972. struct exec {
  1973.         unsigned exec_magic;    /* 0x4d, 0x5a signature */
  1974.         unsigned exec_isr;      /* image size remainder (mod 512) */
  1975.         unsigned exec_size;     /* file size in pages (512) */
  1976.         unsigned exec_nrel;     /* number of relocation items */
  1977.         unsigned exec_hsize;    /* header size in paragraphs */
  1978.         unsigned exec_min;      /* minimum extra paragraphs */
  1979.         unsigned exec_max;      /* maximum extra paragraphs */
  1980.         unsigned exec_ss;       /* stack segment */
  1981.         unsigned exec_sp;       /* stack offset */
  1982.         unsigned exec_cksum;    /* word checksum of entire file */
  1983.         unsigned exec_pc;       /* initial pc */
  1984.         unsigned exec_cs;       /* code segment */
  1985.         unsigned exec_orel;     /* offset of relocation table */
  1986.         unsigned exec_ovno;     /* overlay number */
  1987. };
  1988. -----------------------------------------------------------
  1989. INT 21 - Quit With Exit Code (EXIT)
  1990.         AH = 4Ch
  1991.         AL = exit code
  1992. Return: never returns
  1993. -----------------------------------------------------------
  1994. INT 21 - GET EXIT CODE OF SUBPROGRAM (WAIT)
  1995.         AH = 4Dh
  1996. Return: AL = exit code of subprogram (functions 31h or 4Ch)
  1997.         AH = circumstance which caused termination
  1998.             0 = Terminate/abort
  1999.             1 = Control-C
  2000.             2 = Hard error
  2001.             3 = Terminate and stay resident
  2002. -----------------------------------------------------------
  2003. INT 21 - Find First ASCIIZ (FIND FIRST)
  2004.         AH = 4Eh
  2005.         CX = search attributes
  2006.         DS:DX = pointer to ASCIIZ filename
  2007. Return: CF = 1 if error
  2008.             AX = Error Code if any
  2009.         (DTA) = data block
  2010. -----------------------------------------------------------
  2011. INT 21 - Find Next ASCIIZ (FIND NEXT)
  2012.         AH = 4Fh
  2013. Return: CF = 1 if error
  2014.             AX = Error Code
  2015.         (DTA) = data block
  2016. -----------------------------------------------------------
  2017. INT 21 - Internal - Set PSP Segment
  2018.         AH = 50h
  2019.         BX = Segment address of new PSP
  2020. Note: under DOS 2.xx, this function cannot be invoked inside an INT 28h
  2021. handler
  2022. -----------------------------------------------------------
  2023. INT 21 - Internal - Get PSP Segment
  2024.         AH = 51h
  2025. Return: BX = Current PSP Segment
  2026.  
  2027. struct psp {
  2028.         char psp_int20[2];      /* 00h: exit */
  2029.         unsigned psp_msize;     /* 02h: memory size in paragraphs */
  2030.         char psp_res0[1];       /* 04h: XXX (0) */
  2031.         char psp_dos[5];        /* 05h: far call to dos */
  2032.         int (*psp_term)();      /* 0ah: terminate address */
  2033.         unsigned psp_tseg;      /* 0ch: terminate segment */
  2034.         int (*psp_break)();     /* 0eh: break address */
  2035.         unsigned psp_bseg;      /* 10h: break segment */
  2036.         int (*psp_error)();     /* 12h: error address */
  2037.         unsigned psp_eseg;      /* 14h: error segment */
  2038.         unsigned psp_ppsp;      /* 16h: parent psp segment */
  2039.         char psp_ofile[20];     /* 18h: open files, 0xff = unused */
  2040.         unsigned psp_envp;      /* 2ch: environment segment */
  2041.         char psp_res2[4];       /* 2eh: XXX */
  2042.         int psp_nfiles;         /* 32h: max open files */
  2043.         char *psp_aofile;       /* 34h: ofile address */
  2044.         unsigned psp_aoseg;     /* 36h: ofile segment */
  2045.         char psp_res3[24];      /* 38h: XXX */
  2046.         char psp_int21[3];      /* 50h: int 21, far return */
  2047.         char psp_res4[2];       /* 53h: XXX */
  2048.         char psp_xfcb1[7];      /* 55h: FCB #1 extension */
  2049.         char psp_fcb1[9];       /* 5ch: FCB #1 */
  2050.         char psp_xfcb2[7];      /* 65h: FCB #2 extension */
  2051.         char psp_fcb2[20];      /* 6ch: FCB #2 */
  2052.         char psp_dma[128];      /* 80h: Command Tail */
  2053. };
  2054. Note: under DOS 2.xx, this function cannot be invoked inside an INT 28h
  2055. handler
  2056. -----------------------------------------------------------
  2057. INT 21 - Internal - Get Disk List
  2058.         AH = 52h
  2059. Return: ES:BX points to DOS list of lists
  2060.  
  2061. List of Lists:
  2062. Bytes   Value
  2063. -2&-1   Segment of first memory control block
  2064. 0-3     Pointer to first DOS disk block (see func 36h)
  2065. 4-7     Partially Unknown. Pointer to a device driver. Maybe first
  2066.                resident driver?
  2067. 8-B     Pointer to CLOCK$ device driver, whether installable or
  2068.                resident
  2069. C-F     Pointer to actual CON: device driver, whether installable
  2070.                or resident
  2071. -----DOS 2.x
  2072. 10      Number of logical drives in system
  2073. 11-12   Maximum bytes/block of any block device
  2074. 13-16   unknown
  2075. 17      Beginning (not a pointer. The real beginning!) of NUL device
  2076.            driver. This is the first device on DOS's linked list
  2077.            of device drivers.
  2078. -----DOS 3.x
  2079. 10-11   Maximum bytes/block of any block device (0200h)
  2080. 12-15   Unknown. Pointer to current directory block????
  2081. 16-19   Partially Undefined: Pointer to array of drive info:
  2082.                51h bytes per drive, starting with A: ...
  2083.                00-3F Current path as ASCIIZ, starting with 'x:\'
  2084.                40-43 Unknown. I see zeros always
  2085.                44    Unknown. Flags? I see 40h, except for
  2086.                        entry after last valid entry = 00h
  2087.                45-48 Pointer to DOS Disk Block for this drive
  2088.                49-4A Unknown. Current track or block? -1 if never
  2089.                        accessed.
  2090.                4B-4E Unknown. I see -1 always
  2091.                4F-52 Unknown. I see 2 always
  2092. 1A-1D   Unknown. Pointer to data area, maybe including cluster
  2093.                allocation table?
  2094. 1E-1F   Unknown. I see zero always
  2095. 20      Number of block devices.
  2096. 21      Value of LASTDRIVE command in CONFIG.SYS (default 5)
  2097. 22      Beginning (not a pointer. The real beginning!) of NUL device
  2098.            driver. This is the first device on DOS's linked list
  2099.            of device drivers.
  2100. -----------------------------------------------------------
  2101. INT 21 - Internal - Translate BPB
  2102.         AH = 53h
  2103.         DS:SI points to BPB (Bios Parameter Block)
  2104.         ES:BP points to area for DOS Disk Block
  2105. Translates BPB (Bios Parameter Block, see below)
  2106. into a DOS Disk Block (see function call 32h).
  2107.  
  2108. BPB
  2109. Bytes   Value
  2110. 0-1     Bytes/sector. Get from DDB bytes 2-3.
  2111. 2       Sectors/cluster. Get from: (DDB byte 4) + 1
  2112. 3-4     Reserved sectors. Get from: DDB bytes 6-7
  2113. 5       Number of FATs. Get from: DDB byte 8
  2114. 6-7     Number of root dir entries. Get from: DDB bytes 9-A
  2115. 8-9     Total # of sectors. Get from:
  2116.         ((DDB bytes D-E) - 1) * (sectors per cluster (BPB byte 2))
  2117.           + (DDB Bytes B-C)
  2118. A       Media descriptor byte. Get from: DDB byte 16
  2119. B-C     Number of sectors/FAT. Get from: DDB byte F
  2120. -----------------------------------------------------------
  2121. INT 21 - Get Verify Flag
  2122.         AH = 54h
  2123. Return: AL = 0 if flag OFF
  2124.         AL = 1 if flag ON
  2125. -----------------------------------------------------------
  2126. INT 21 - Internal - Create PSP
  2127.         AH = 55h
  2128.         DX = Segment number to set up PSP at
  2129. Note: Like FN 26h but creates "child" PSP rather than copying existing one.
  2130. -----------------------------------------------------------
  2131. INT 21 - RENAME A FILE
  2132.         AH = 56h
  2133.         DS:DX = pointer to ASCIZ old name
  2134.         ES:DI = pointer to ASCIZ new name
  2135. Return: CF = 1 if error
  2136.             AX = Error Code
  2137. -----------------------------------------------------------
  2138. INT 21 - Get/Put Date/Time
  2139.         AH = 57h
  2140.         AL = function code
  2141.             0 = get date and time
  2142.             1 = set date and time
  2143.                CX = time to be set
  2144.                DX = date to be set
  2145.         BX = file handle
  2146. Return: CF = 1 if error
  2147.             AX = Error Code
  2148.         CX = time of last write (if AL = 0)
  2149.         DX = date of last write (if AL = 0)
  2150. -----------------------------------------------------------
  2151. INT 21 - Get/Set allocation strategy (DOS 3.x)
  2152.         AH = 58h
  2153.         AL = function code
  2154.             0 = get allocation strategy
  2155.             1 = set allocation strategy
  2156.                BL = strategy code
  2157.                    0 first fit (use first memory block large enough)
  2158.                    1 best fit (use smallest memory block large enough)
  2159.                    2 last fit (use high part of last usable memory block)
  2160. Return: CF = 1 error
  2161.             AX = Error Code
  2162.         CF = 0 successful
  2163.             AX = strategy code
  2164. Note: the Set subfunction accepts any value in BL; 2 or greater means last fit.
  2165.       the Get subfunction returns the last value set, so programs should check
  2166.       whether the value is >= 2, not just equal to 2.
  2167. -----------------------------------------------------------
  2168. INT 21 - GET EXTENDED ERROR CODE (DOS 3.X)
  2169.         AH = 59h
  2170.         BX = version code (0000 for DOS 3.0)
  2171. Return: AX = extended error code
  2172.         BH = class of error
  2173.         BL = suggested action code
  2174.         CH = locus (where error occurred)
  2175. Error codes:
  2176.         01 function number invalid
  2177.         02 file not found
  2178.         03 path not found
  2179.         04 too many open files
  2180.         05 access denied
  2181.         06 invalid handle
  2182.         07 memory control block destroyed
  2183.         08 insufficient memory
  2184.         09 memory block address invalid
  2185.         0A environment invalid
  2186.         0B format invalid
  2187.         0C access code invalid
  2188.         0D data invalid
  2189.         0F invalid drive
  2190.         10 attempted to remove current directory
  2191.         11 not same device
  2192.         12 no more files
  2193.         13 disk write-protected
  2194.         14 unknown unit
  2195.         15 drive not ready
  2196.         16 unknown command
  2197.         17 data error (CRC)
  2198.         18 bad request structure length
  2199.         19 seek error
  2200.         1A unknwon media type
  2201.         1B sector not found
  2202.         1C printer out of paper
  2203.         1D write fault
  2204.         1E read fault
  2205.         1F general failure
  2206.         20 sharing violation
  2207.         21 lock violation
  2208.         22 disk change invalid
  2209.         23 FCB unavailable
  2210.         24-31 reserved
  2211.         32 Network request not supported (DOS 3.1 + MS Networks)
  2212.         33 Remote computer not listening
  2213.         34 Duplicate name on network
  2214.         35 Network name not found
  2215.         36 Network busy
  2216.         37 Network device no longer exists
  2217.         38 Network BIOS command limit exceeded
  2218.         39 Network adapter hardware error
  2219.         3A Incorrect response from network
  2220.         3B Unexpected network error
  2221.         3C Incompatible remote adapter
  2222.         3D Print queue full
  2223.         3E Queue not full
  2224.         3F Not enough space to print file
  2225.         40 Network name was deleted
  2226.         41 Network: Access denied
  2227.         42 Network device type incorrect
  2228.         43 Network name not found
  2229.         44 Network name limit exceeded
  2230.         45 Network BIOS session limit exceeded
  2231.         46 Temporarily paused
  2232.         47 Network request not accepted
  2233.         48 Print/disk redirection paused (DOS 3.1 + MS Networks)
  2234.         49-4F reserved
  2235.         50 file exists
  2236.         51 reserved
  2237.         52 cannot make directory
  2238.         53 fail on INT 24h
  2239. Error Classes:
  2240.         01 out of resource
  2241.         02 temporary situation
  2242.         03 authorization (denied access)
  2243.         04 internal
  2244.         05 hardware failure
  2245.         06 system failure
  2246.         07 application program error
  2247.         08 not found
  2248.         09 bad format
  2249.         0A locked
  2250.         0B media error
  2251.         0C already exists
  2252.         0D unknown
  2253. Suggested Action:
  2254.         01 retry
  2255.         02 delayed retry
  2256.         03 prompt user
  2257.         04 abort after cleanup
  2258.         05 immediate abort
  2259.         06 ignore
  2260.         07 retry after user intervention
  2261. Error Locus:
  2262.         01 unknown or not appropriate
  2263.         02 block device
  2264.         03 network related
  2265.         04 serial device
  2266.         05 memory related
  2267. -----------------------------------------------------------
  2268. INT 21 - CREATE TMEPORARY FILE (DOS 3.x)
  2269.         AH = 5Ah
  2270.         DS:DX = pointer to ASCIZ directory path name
  2271.         CX = file attribute
  2272. Return: CF = 1 if error
  2273.             AX = Error Code if any
  2274.         DS:DX = path name
  2275. Note: The file created is not truly "temporary".  It MUST be removed
  2276.       by the user.
  2277. -----------------------------------------------------------
  2278. INT 21 - CREATE NEW FILE (DOS 3.x)
  2279.         AH = 5Bh
  2280.         DS:DX = pointer to ASCIZ directory path name
  2281.         CX = file attribute
  2282. Return: CF = 1 if error
  2283.             AX = Error Code if any
  2284.         DS:DX = path name
  2285. Note: Unlike function 3Ch, function 5Bh will fail if the file already
  2286.       exists.
  2287. -----------------------------------------------------------
  2288. INT 21 - LOCK/UNLOCK FILE ACCESS (DOS 3.x)
  2289.         AH = 5Ch
  2290.         AL = 0 if lock
  2291.              1 if unlock
  2292.         BX = file handle
  2293.         CX:DX = starting offset of region to lock
  2294.         SI:DI = size of region to lock
  2295. Return: CF = 1 if error
  2296.             AX = Error Code
  2297. -----------------------------------------------------------
  2298. INT 21 - Internal - Get address of critical error flag
  2299.         AX = 5D06h
  2300. Return: DS:SI = pointer to critical error flag
  2301.         CX = ???
  2302.         DX = ???
  2303. Note: this call also does a lot of other work in addition to returning
  2304.    the pointer
  2305. -----------------------------------------------------------
  2306. INT 21 - Internal - Unknown
  2307.         AH = 5Dh
  2308.         AL = subfunction
  2309.              07h: ???
  2310.              08h: (used by COMMAND.COM)
  2311.              09h: (used by COMMAND.COM)
  2312. -----------------------------------------------------------
  2313. INT 21 - Get Machine Name (DOS 3.1 + Microsoft Networks)
  2314.         AX = 5E00h
  2315.         DS:DX -> buffer for ASCIIZ name
  2316. Return: CF = 1 if error
  2317.             AX = Error Code
  2318.         CH = 0 if name not defined
  2319.         CL = NETBIOS name number
  2320.         DS:DX -> pointer to identifier if CH <> 0
  2321. -----------------------------------------------------------
  2322. INT 21 - Set Printer Setup (DOS 3.1 + Microsoft Networks)
  2323.         AX = 5E02h
  2324.         BX = Redirection list index
  2325.         CX = length of setup string <= 64
  2326.         DS:SI -> string buffer
  2327. Return: CF = 1 if error
  2328.             AX = Error Code
  2329. -----------------------------------------------------------
  2330. INT 21 - Get Printer Setup (DOS 3.1 + Microsoft Networks)
  2331.         AX = 5E03h
  2332.         BX = Redirection list index
  2333.         ES:DI -> string buffer
  2334. Return: CF = 1 if error
  2335.             AX = Error Code
  2336.         CX = length of setup string <= 64
  2337. -----------------------------------------------------------
  2338. INT 21 - Get Redirection List Entry (DOS 3.1 + Microsoft Networks)
  2339.         AX = 5F02h
  2340.         BX = Redirection list index
  2341.         DS:SI -> 16 char local device name buffer
  2342.         ES:DI -> 128 char network name buffer
  2343. Return: CF = 1 if error
  2344.             AX = Error Code
  2345.         BH = Device status flag (BIT 0 = 0 if valid)
  2346.         BL = device type (03 if printer, 04 if drive)
  2347.         CX = stored parameter value
  2348. Note: DX and BP are destroyed by this call!
  2349. -----------------------------------------------------------
  2350. INT 21 - Redirect Device (DOS 3.1 + Microsoft Networks)
  2351.         AX = 5F03h
  2352.         BL = device type
  2353.                 03 = printer device
  2354.                 04 = file device
  2355.         CX = stored parameter value
  2356.         DS:SI -> source device name
  2357.         ES:DI -> destination ASCIIZ network path + ASCIIZ password
  2358. Return: CF = 1 if error
  2359.             AX = Error Code
  2360. -----------------------------------------------------------
  2361. INT 21 - Cancel Redirection (DOS 3.1 + Microsoft Networks)
  2362.         AX = 5F04h
  2363.         DS:SI -> device name or network path
  2364. Return: CF = 1 if error
  2365.             AX = Error Code
  2366. -----------------------------------------------------------
  2367. INT 21 - Internal - Resolve path string to fully qualified path string
  2368.         AH = 60h
  2369.         DI:SI = relative path strings
  2370.         ES:DI = buffer for fully qualified name
  2371. Return: buffer filled with qualified name
  2372.         may return error code, unknown.
  2373. -----------------------------------------------------------
  2374. INT 21 - Internal - Unused (DOS 3.x)
  2375.         AH = 61h
  2376. Return: AL = 0
  2377. -----------------------------------------------------------
  2378. INT 21 - GET PSP ADDRESS (DOS 3.x)
  2379.         AH = 62h
  2380. Return: BX = segment address of PSP
  2381. -----------------------------------------------------------
  2382. INT 21 - GET LEAD BYTE TABLE (DOS 2.25 only)
  2383.         AH = 63h
  2384.         AL = subfunction
  2385.              0 = get system lead byte table
  2386.              1 = set/clear interim console flag
  2387.                 DL = 1/0 to set/clear interim console flag
  2388.              2 = get interim console flag
  2389. Return: DS:SI -> lead byte table (AL = 0)
  2390.         DL = interim console flag (AL = 2)
  2391. -----------------------------------------------------------
  2392. INT 21 - Internal - unknown (DOS 3.3)
  2393.         AH = 64h
  2394. -----------------------------------------------------------
  2395. INT 21 - GET EXTENDED COUNTRY INFORMATION (DOS 3.3)
  2396.         AH = 65h
  2397.         AL = info ID (1 - 6)
  2398.         BX = code page (-1=global code page)
  2399.         DX = country ID (-1=current country)
  2400.         ES:DI = pointer to country information buffer
  2401.         CX = size of buffer
  2402. Return: AX = error code if carry set, otherwise
  2403.         CX = size of country information returned
  2404.         ES:DI = pointer to country information:
  2405.                1 BYTE info ID
  2406.                if info ID <> 1
  2407.                   1 DWORD pointer to information
  2408.                if info ID == 1
  2409.                   1 WORD size
  2410.                   1 WORD country ID
  2411.                   1 WORD code page
  2412.                  34 BYTE see function 38h
  2413. -----------------------------------------------------------
  2414. INT 21 - GET/SET GLOBAL CODE PAGE TABLE (DOS 3.3)
  2415.         AH = 66h
  2416.         AL = 00h get global code page
  2417.              Return: AX = error code if carry flag set
  2418.                      BX = active code page
  2419.                      DX = system code page
  2420.            = 01h set global page
  2421.              BX = active code page
  2422.              DX = system code page (active page at boot time)
  2423.              Return: AX = error code if carry flag set
  2424. -----------------------------------------------------------
  2425. INT 21 - SET HANDLE COUNT (DOS 3.3)
  2426.         AH = 67h
  2427.         BX = desired number of handles (max 255)
  2428. Return: Carry clear if ok
  2429.         Carry set if error (and error code in AX)
  2430. -----------------------------------------------------------
  2431. INT 21 - COMMIT FILE - WRITE ALL BUFFERED DATA TO DISK (DOS 3.3)
  2432.         AH = 68h
  2433.         BX = file handle
  2434. Return: carry flag set on error (and error code in AX)
  2435. -----------------------------------------------------------
  2436. INT 21 - DoubleDos -
  2437.         AX = E400h
  2438. Return: AL <> 0 if DoubleDos is active
  2439. -----------------------------------------------------------
  2440. INT 21 - DoubleDos - Turn off Task Switching
  2441.         AH = EAh
  2442. Return: task switching turned off
  2443. -----------------------------------------------------------
  2444. INT 21 - DoubleDos - Turn on Task Switching
  2445.         AH = EBh
  2446. Return: task switching turned on
  2447. -----------------------------------------------------------
  2448. INT 21 - DoubleDos - Get Virtual Screen Address
  2449.         AH = ECh
  2450. Return: ES = segment of virtual screen
  2451. Note: Screen address can change if task-switching is on!!
  2452. -----------------------------------------------------------
  2453. INT 21 - DoubleDos - Give away time to other tasks
  2454.         AH = EEh
  2455.         AL = number of 55ms time slices to give away
  2456. Return: returns after giving away time slices
  2457. -----------------------------------------------------------
  2458. INT 21 - CED installable commands
  2459.         AH = 0FFh
  2460.            AL = 0 add installable command
  2461.              BL = mode - bit 0 = 1 callable from DOS prompt
  2462.                          bit 1 = 1 callable from application
  2463.              DS:SI pointer to CR-terminated command name
  2464.              ES:DI pointer to FAR routine entry point
  2465.            AL = 1 remove installable command
  2466.              DS:SI pointer to CR-terminated command name
  2467.            AL = 2 reserved, may be used to test for CED installation
  2468. Return: CF set on error
  2469.             AX = 01h invalid function
  2470.                  02h command not found (subfunction 1 only)
  2471.                  08h insufficient memory (subfunction 0 only)
  2472.                  0Eh bad data (subfunction 0 only)
  2473.         AH = 0FFh if CED not installed
  2474. -----------------------------------------------------------
  2475. INT 22 - TERMINATE ADDRESS
  2476.    FAR (DWORD) address of routine to be executed when program
  2477.    "returns to DOS".  Should NEVER be called directly.
  2478. -----------------------------------------------------------
  2479. INT 23 - CONTROL "C" EXIT ADDRESS
  2480.    Automatically called from keyboard scanner when CTRL-C or
  2481.    CTRL-BREAK is detected. Normally aborts program and returns
  2482.    to DOS, but may be changed.
  2483. -----------------------------------------------------------
  2484. INT 24 - FATAL ERROR ABORT ADDRESS
  2485.    Automatically called upon detection of unrecoverable
  2486.    disk error. Normally prints "Abort, Retry, or Ignore?" message
  2487.    and takes the reply, but may be changed if desired.
  2488.  
  2489. Provides the following values in registers on entry to interrupt handler:
  2490.         AH: bit 7 = 0 disk I/O error
  2491.                   = 1 other error -- if block device, bad FAT
  2492.                                   -- if char device, code in DI
  2493.             bit 6  unused
  2494.             bit 5 = 1 if Ignore allowed, 0 if not (DOS 3.2?)
  2495.             bit 4 = 1 if Retry allowed, 0 if not (DOS 3.2?)
  2496.             bit 3 = 1 if Fail allowed, 0 if not (DOS 3.2+)
  2497.             bit 2 \ disk area of error  00 = DOS area  01 = FAT
  2498.             bit 1 /                     10 = root dir  11 = data area
  2499.             bit 0 = 1 if write, 0 if read
  2500.         AL = drive number if AH bit 7 = 1, otherwise undefined
  2501.         BP:SI = address of device header for which error occurred
  2502.             block device if high bit of BP:SI+4 = 1
  2503.         low byte of DI:
  2504.            00h write-protect error
  2505.            01h unknown unit
  2506.            02h drive not ready
  2507.            03h unknown command
  2508.            04h data error (bad CRC)
  2509.            05h bad request structure length
  2510.            06h seek error
  2511.            07h unknown media type
  2512.            08h sector not found
  2513.            09h printer out of paper
  2514.            0Ah write fault
  2515.            0Bh read fault
  2516.            0Ch general failure
  2517.            0Fh invalid disk change (DOS 3.x)
  2518. Handler must return
  2519.         AL = 00 ignore error
  2520.            = 01 retry operation
  2521.            = 02 terminate program through INT 22h
  2522.            = 03 fail system call in progress (DOS 3.2+)
  2523. -----------------------------------------------------------
  2524. INT 25 - ABSOLUTE DISK READ
  2525.         AL = Drive number (0=A, 1=B, etc)
  2526.         DS:BX = Disk Transfer Address (buffer)
  2527.         CX = Number of sectors to read
  2528.         DX = First relative sector to read
  2529. Return: CF = 1 if error
  2530.             AL = error code issued to INT 24h in low half of DI
  2531.             AH = 80h if attachment failed to respond
  2532.                  40h if seek operation failed
  2533.                  20h if controller failed
  2534.                  10h if data error (bad CRC)
  2535.                  08h if DMA failure
  2536.                  04h if requested sector not found
  2537.                  03h if write-protected disk
  2538.                  02h if bad address mark
  2539.                  01h if bad command
  2540. Note: ORIGINAL FLAGS ON STACK!
  2541. -----------------------------------------------------------
  2542. INT 26 - ABSOLUTE DISK WRITE
  2543.         AL = Drive number (0=A, 1=B, etc)
  2544.         DS:BX = Disk Transfer Address (buffer)
  2545.         CX = Number of sectors to write
  2546.         DX = First relative sector to write
  2547. Return: CF = 1 if error
  2548.             AL = error code issued to INT 24h in low half of DI
  2549.             AH = same error codes as for INT 25h
  2550. Note: ORIGINAL FLAGS ON STACK!
  2551. -----------------------------------------------------------
  2552. INT 27 - TERMINATE BUT STAY RESIDENT
  2553.         CS = current program segment
  2554.         DX = last program byte + 1
  2555. -----------------------------------------------------------
  2556. INT 28 - Internal - Keyboard Busy Loop
  2557.    This interrupt is called from inside the "get input from keyboard"
  2558.    routine in DOS, if and only if it is safe to use INT 21 to access
  2559.    the disk at that time. It is used primarily by the PRINT.COM
  2560.    routines and TSR programs, but any number of other routines could
  2561.    be chained to it by saving the original vector, and calling it
  2562.    with a FAR call (or just JMPing to it) at the end of the new
  2563.    routine.
  2564.  
  2565.    The INT 28h handler may invoke any INT 21h function except functions
  2566.    00h through 0Ch (and 50h/51h under DOS 2.xx).
  2567.  
  2568.    Until some program installs its own routine, this interrupt vector
  2569.    simply points to an IRET opcode.
  2570. -----------------------------------------------------------
  2571. INT 29 - Internal - Fast Putchar
  2572.    This interrupt is called from the DOS output routines if output
  2573.    is going to a device rather than a file, and the device driver's
  2574.    attribute word has bit 3 (04h) set to "1".
  2575. -----------------------------------------------------------
  2576. INT 2A - Network Installation Check (Microsoft Networks)
  2577.         AH = 00h
  2578. Return: AH <> 0 if installed
  2579. -----------------------------------------------------------
  2580. INT 2A - Check Direct I/O (Microsoft Networks)
  2581.         AX = 0300h
  2582.         DS:SI -> ASCIIZ disk device name
  2583. Return: CF == 0 if allowed
  2584. -----------------------------------------------------------
  2585. INT 2A - Execute NETBIOS (Microsoft Networks)
  2586.         AH = 04h
  2587.         AL = 0 for error retry, 1 for no retry
  2588.         ES:BX -> NCB
  2589. Return: AX = 0 for no error
  2590.         AH = 1, AL = error code
  2591. -----------------------------------------------------------
  2592. INT 2A - Get Network Resource Information (Microsoft Networks)
  2593.         AX = 0500h
  2594. Return: AX = reserved
  2595.         BX = number of network names
  2596.         CX = number of commands
  2597.         DX = number of sessions
  2598. -----------------------------------------------------------
  2599. INT 2A - Unknown
  2600.         AH = 82h
  2601. Return: ???
  2602. Note: Called by the INT 21h function dispatcher in DOS 3.10
  2603. -----------------------------------------------------------
  2604. INT 2B - Internal routine for MSDOS (IRET)
  2605. -----------------------------------------------------------
  2606. INT 2C - Internal routine for MSDOS (IRET)
  2607. -----------------------------------------------------------
  2608. INT 2D - Internal routine for MSDOS (IRET)
  2609. -----------------------------------------------------------
  2610. INT 2E - Internal - Execute Command
  2611.         ES:SI -> counted CR-terminated command string
  2612.  
  2613. The top-level command.com executes the command; all registers
  2614. are destroyed as in exec.
  2615. -----------------------------------------------------------
  2616. INT 2F - Multiplexor - PRINT Installation Check
  2617.         AX = 0100h
  2618. Return: AL =
  2619.             FFh installed
  2620.             01h not installed, not OK to install
  2621.             00h not installed, OK to install
  2622. -----------------------------------------------------------
  2623. INT 2F - Multiplexor - PRINT Submit file
  2624.         AX = 0101h
  2625.         DS:DX -> packet of one byte level and DWORD file pointer
  2626. Return: CF = 1 if error
  2627.             AX = Error Code
  2628. -----------------------------------------------------------
  2629. INT 2F - Multiplexor - PRINT Remove file
  2630.         AX = 0102h
  2631.         DS:DX -> file name (wildcards allowed)
  2632. Return: CF = 1 if error
  2633.             AX = Error Code
  2634. -----------------------------------------------------------
  2635. INT 2F - Multiplexor - PRINT Remove all files
  2636.         AX = 0103h
  2637. Return: CF = 1 if error
  2638.             AX = Error Code
  2639. -----------------------------------------------------------
  2640. INT 2F - Multiplexor - PRINT Hold queue/Get status
  2641.         AX = 0104h
  2642. Return: CF = 1 if error
  2643.             AX = Error Code
  2644.                 01h function invalid
  2645.                 02h file not found
  2646.                 03h path not found
  2647.                 04h too many open files
  2648.                 05h access denied
  2649.                 08h queue full
  2650.                 09h spooler busy
  2651.                 0Ch name too long
  2652.                 0Fh drive invalid
  2653.         DX = Error count
  2654.         DS:SI -> print queue (null-string terminated
  2655.                  list of 64-byte ASCIZ file names)
  2656. -----------------------------------------------------------
  2657. INT 2F - Multiplexor - PRINT Restart queue
  2658.         AX = 0105h
  2659. Return: Flag CF = 1 if error
  2660.         AX = Error Code if any
  2661. -----------------------------------------------------------
  2662. INT 2F - Multiplexor - ASSIGN Installation Check
  2663.         AX = 0600h
  2664. Return: AH <> 0 if installed
  2665. -----------------------------------------------------------
  2666. INT 2F - Multiplexor - ASSIGN
  2667.         AX = 0601h XXX
  2668. -----------------------------------------------------------
  2669. INT 2F - Multiplexor - MSDOS Internal
  2670.         AH = 10h XXX
  2671. -----------------------------------------------------------
  2672. INT 2F - Multiplexor - MSDOS Internal
  2673.         AH = 11h XXX
  2674. -----------------------------------------------------------
  2675. INT 2F - Multiplexor - MSDOS Internal
  2676.         AH = 12h XXX
  2677. -----------------------------------------------------------
  2678. INT 2F - Multiplexor - APPEND Installation Check
  2679.         AX = B700h
  2680. Return: AH <> 0 if installed
  2681. -----------------------------------------------------------
  2682. INT 2F - Multiplexor - APPEND
  2683.         AX = B701h XXX
  2684. -----------------------------------------------------------
  2685. INT 2F - Multiplexor - Network Program Installation Check
  2686.         AX = B800h
  2687. Return: AH <> 0 if installed
  2688. -----------------------------------------------------------
  2689. INT 2F - Multiplexor - Get Current Post Address
  2690.         AX = B803h
  2691. Return: ES:BX = post address
  2692. -----------------------------------------------------------
  2693. INT 2F - Multiplexor - Set New Post Address
  2694.         AX = B804h
  2695.         ES:BX = new post address
  2696. -----------------------------------------------------------
  2697. INT 30 -> (NOT A VECTOR!) FAR jump instruction for CP/M-style calls
  2698. INT 31
  2699. -----------------------------------------------------------
  2700. INT 32 -> not used
  2701. -----------------------------------------------------------
  2702. INT 33 -> USED BY MICROSOFT MOUSE
  2703. -----------------------------------------------------------
  2704. INT 40 -> Relocated (by fixed disk) Floppy Handler (original INT 13h)
  2705. -----------------------------------------------------------
  2706. INT 41 -> Fixed Disk Params
  2707.         dw      cylinders
  2708.         db      heads
  2709.         dw      0
  2710.         dw      write pre-comp
  2711.         db      0
  2712.         db      0 "control byte"
  2713.         db      0, 0, 0
  2714.         dw      landing zone
  2715.         db      sectors/track
  2716.         db      0
  2717. -----------------------------------------------------------
  2718. INT 42 -> Relocated (by EGA) Video Handler (original INT 10h)
  2719. -----------------------------------------------------------
  2720. INT 43 -> EGA Initialization Params
  2721. -----------------------------------------------------------
  2722. INT 44 -> EGA/PCjr fonts
  2723. -----------------------------------------------------------
  2724. INT 45 -> reserved
  2725. -----------------------------------------------------------
  2726. INT 46 -> Secondary Fixed Disk Params (see INT 41h)
  2727. -----------------------------------------------------------
  2728. INT 47 -> reserved
  2729. -----------------------------------------------------------
  2730. INT 48 -> PCjr Cordless Keyboard Translation
  2731. -----------------------------------------------------------
  2732. INT 49 -> PCjr Non-keyboard Scan Code Translation Table
  2733. -----------------------------------------------------------
  2734. INT 4A -> AT User Alarm
  2735. -----------------------------------------------------------
  2736. INT 4B -> reserved
  2737. -----------------------------------------------------------
  2738. INT 4C -> reserved
  2739. -----------------------------------------------------------
  2740. INT 4D -> reserved
  2741. -----------------------------------------------------------
  2742. INT 4E -> reserved
  2743. -----------------------------------------------------------
  2744. INT 4F -> reserved
  2745. -----------------------------------------------------------
  2746. INT 50-57 -> IRQ0-IRQ7 relocated by DESQview
  2747. -----------------------------------------------------------
  2748. INT 58 -> reserved
  2749. -----------------------------------------------------------
  2750. INT 59 -> reserved
  2751. -----------------------------------------------------------
  2752. INT 5A -> reserved
  2753. -----------------------------------------------------------
  2754. INT 5B -> reserved
  2755. -----------------------------------------------------------
  2756. INT 5C - NETBIOS interface
  2757.         ES:BX -> Network Control Block
  2758. -----------------------------------------------------------
  2759. INT 5D -> reserved
  2760. -----------------------------------------------------------
  2761. INT 5E -> reserved
  2762. -----------------------------------------------------------
  2763. INT 5F -> reserved
  2764. -----------------------------------------------------------
  2765. INT 60-67 -> reserved for user interrupts
  2766. -----------------------------------------------------------
  2767. INT 67 - LIM EMS - Get Manager Status
  2768.         AH = 40h
  2769. Return: AH = status
  2770.             00h successful
  2771.             80h internal error
  2772.             81h hardware malfunction
  2773.             84h undefined function requested by application
  2774. Note: this call can be used only after establishing that the EMS driver
  2775.       is in fact present
  2776. -----------------------------------------------------------
  2777. INT 67 - LIM EMS - Get Page Frame Segment
  2778.         AH = 41h
  2779. Return: AH = 00h function successful
  2780.             BX = segment of page frame
  2781.         AH = error code (see AH=40h above)
  2782. -----------------------------------------------------------
  2783. INT 67 - LIM EMS - Get Number of Pages
  2784.         AH = 42h
  2785. Return: AH = 00h function successful
  2786.             BX = number of unallocated pages
  2787.             DX = total number of pages
  2788.         AH = error code (see AH=40h above)
  2789. -----------------------------------------------------------
  2790. INT 67 - LIM EMS - Get Handle and Allocate Memory
  2791.         AH = 43h
  2792.         BX = number of logical pages to allocate
  2793. Return: AH = status
  2794.             00h function successful
  2795.                 DX = handle
  2796.             80h internal error
  2797.             81h hardware malfunction
  2798.             84h undefined function requested
  2799.             85h no more handles available
  2800.             87h more pages requested than physically exist
  2801.             88h more pages requested than currently available
  2802.             89h zero pages requested
  2803. -----------------------------------------------------------
  2804. INT 67 - LIM EMS - Map Memory
  2805.         AH = 44h
  2806.         AL = physical page number (0-3)
  2807.         BX = logical page number
  2808.         DX = handle
  2809. Return: AH = status
  2810.             00h function successful
  2811.             80h internal error
  2812.             81h hardware malfunction
  2813.             83h invalid handle
  2814.             84h undefined function requested
  2815.             8Ah invalid logical page number
  2816.             8Bh illegal physical-page number
  2817. -----------------------------------------------------------
  2818. INT 67 - LIM EMS - Release Handle and Memory
  2819.         AH = 45h
  2820.         DX = EMM handle
  2821. Return: AH = status
  2822.             00h successful
  2823.             80h internal error
  2824.             81h hardware malfunction
  2825.             83h invalid handle
  2826.             84h undefined function requested
  2827.             86h error in save or restore of mapping context
  2828. -----------------------------------------------------------
  2829. INT 67 - LIM EMS - Get EMM Version
  2830.         AH = 46h
  2831. Return: AH = status
  2832.             00h successful
  2833.                 AL = EMM version number
  2834.             80h internal error
  2835.             81h hardware malfunction
  2836.             84h undefined function requested
  2837. -----------------------------------------------------------
  2838. INT 67 - LIM EMS - Save Mapping Context
  2839.         AH = 47h
  2840.         DX = handle
  2841. Return: AH = status
  2842.             00h successful
  2843.             80h internal error
  2844.             81h hardware malfunction
  2845.             83h invalid handle
  2846.             84h undefined function requested
  2847.             8Ch page-mapping hardware state save area is full
  2848.             8Dh save of mapping context failed
  2849. -----------------------------------------------------------
  2850. INT 67 - LIM EMS - Restore Maping Context
  2851.         AH = 48h
  2852.         DX = handle
  2853. Return: AH = status
  2854.             00h successful
  2855.             80h internal error
  2856.             81h hardware malfunction
  2857.             83h invalid handle
  2858.             84h undefined function requested
  2859.             8Eh restore of mapping context failed
  2860. -----------------------------------------------------------
  2861. INT 67 - LIM EMS - reserved
  2862.         AH = 49h
  2863. Note: defined in EMS 3.0, but undocumented in EMS 3.2
  2864. -----------------------------------------------------------
  2865. INT 67 - LIM EMS - reserved
  2866.         AH = 4Ah
  2867. Note: defined in EMS 3.0, but undocumented in EMS 3.2
  2868. -----------------------------------------------------------
  2869. INT 67 - LIM EMS - Get Number of EMM Handles
  2870.         AH = 4Bh
  2871. Return: AH = status
  2872.             00h successful
  2873.                 BX = number of EMM handles
  2874.             80h internal error
  2875.             81h hardware malfunction
  2876.             83h invalid handle
  2877.             84h undefined function requested
  2878. -----------------------------------------------------------
  2879. INT 67 - LIM EMS - Get Pages Owned by Handle
  2880.         AH = 4Ch
  2881.         DX = EMM handle
  2882. Return: AH = status
  2883.             00h successful
  2884.                 BX = number of logical pages
  2885.             80h internal error
  2886.             81h hardware malfunction
  2887.             83h invalid handle
  2888.             84h undefined function requested
  2889. -----------------------------------------------------------
  2890. INT 67 - LIM EMS - Get Pages for All Handles
  2891.         AH = 4Dh
  2892.         ES:DI = pointer to array to receive information
  2893. Return: AH = status
  2894.             00h successful
  2895.                 BX = number of active EMM handles
  2896.                 array filled with 2-word entries, consisting of a handle
  2897.                   and the number of pages allocated to that handle
  2898.             80h internal error
  2899.             81h hardware malfunction
  2900.             84h undefined function requested
  2901. -----------------------------------------------------------
  2902. INT 67 - LIM EMS - Get or Set Page Map
  2903.         AH = 4Eh
  2904.         AL = 00h if getting mapping registers
  2905.              01h if setting mapping registers
  2906.              02h if getting and setting mapping registers at once
  2907.              03h if getting size of page-mapping array
  2908.         DS:SI = pointer to array holding information (AL=01/02)
  2909.         ES:DI = pointer to array to receive information (AL=00/02)
  2910. Return: AH = status
  2911.             00h successful
  2912.                 AL = bytes in page-mapping array (subfunction 03h only)
  2913.                 array pointed to by ES:DI receives mapping info (AL=00/02)
  2914.             80h internal error
  2915.             81h hardware malfunction
  2916.             84h undefined function requested
  2917.             8Fh undefined subfunction parameter
  2918.             A3h contents of source array corrupted (EMS 4.0?)
  2919. Note: this function was designed to be used by multitasking operating systems
  2920.       and should not ordinarily be used by appplication software.
  2921. -----------------------------------------------------------
  2922. INT 67 - LIM EMS 4.0 - Get/Set Partial Page Map
  2923.         AH = 4Fh
  2924.         AL = subfunction
  2925.             00h get partial page map
  2926.                DS:SI = pointer to structure containing list of segments whose
  2927.                        mapping contexts are to be saved
  2928.                ES:DI = pointer to array to receive page map
  2929.             01h set partial page map
  2930.                DS:SI = pointer to structure containing saved partial page map
  2931.             02h get size of partial page map
  2932.                BX = number of mappable segments in the partial map to be saved
  2933. Return: AH = status
  2934.             00h successful
  2935.             80h internal error
  2936.             81h hardware malfunction
  2937.             84h undefined function requested
  2938.             8Bh one of specified segments is not mappable
  2939.             8Fh undefined subfunction parameter
  2940.             A3h contents of partial page map corrupted or count of mappable
  2941.                 segments exceeds total number of mappable segments in system
  2942.         AL = size of partial page map for subfunction 02h
  2943. -----------------------------------------------------------
  2944. INT 67 - LIM EMS 4.0 - Map/Unmap Multiple Handle Pages
  2945.         AH = 50h
  2946.         AL = subfunction
  2947.             00h
  2948.             01h
  2949.         DX = handle
  2950.         CX = number of entries in array
  2951.         DS:SI = pointer to mapping array
  2952. Return: AH = status
  2953.             00h successful
  2954.             80h internal error
  2955.             81h hardware malfunction
  2956.             83h invalid handle
  2957.             84h undefined function requested
  2958.             8Ah one or more logical pages are invalid
  2959.             8Bh one or more physical pages are invalid
  2960.             8Fh invalid subfunction
  2961. -----------------------------------------------------------
  2962. INT 67 - LIM EMS 4.0 - Reallocate Pages
  2963.         AH = 51h
  2964.         DX = handle
  2965.         BX = number of pages to be allocated to handle
  2966. Return: BX = actual number of pages allocated to handle
  2967.         AH = status
  2968.             00h successful
  2969.             80h internal error
  2970.             81h hardware malfunction
  2971.             83h invalid handle
  2972.             84h undefined function requested
  2973.             87h more pages requested than present in system
  2974.             88h more pages requested than currently available
  2975. -----------------------------------------------------------
  2976. INT 67 - LIM EMS 4.0 - Get/Set Handle Attributes
  2977.         AH = 52h
  2978.         AL = subfunction
  2979.             00h get handle attributes
  2980.             01h set handle attributes
  2981.                BL = new attribute (see returned AL)
  2982.             02h get attribute capability
  2983.         DX = handle
  2984. Return: AL = attribute (for subfunction 00h)
  2985.             00h handle is volatile
  2986.             01h handle is nonvolatile
  2987.         AL = attribute capability (for subfunction 02h)
  2988.             00h only volatile handles supported
  2989.             01h both volatile and non-volatile supported
  2990.         AH = status
  2991.             00h successful
  2992.             80h internal error
  2993.             81h hardware malfunction
  2994.             83h invalid handle
  2995.             84h undefined function requested
  2996.             8Fh undefined subfunction
  2997.             90h undefined attribute type
  2998.             91h feature not supported
  2999.  
  3000.         AH = 53h
  3001.         AL = subfunction
  3002.             00h get handle name
  3003.                ES:DI = pointer to 8-byte handle name array
  3004.             01h set handle name
  3005.                DS:SI = pointer to 8-byte handle name
  3006.         DX = handle
  3007. Return: AH = status
  3008.             00h successful
  3009.             80h internal error
  3010.             81h hardware malfunction
  3011.             83h invalid handle
  3012.             84h undefined function requested
  3013.             8Fh undefined subfunction
  3014.             A1h duplicate handle name
  3015. -----------------------------------------------------------
  3016. INT 67 - LIM EMS 4.0 - Get Handle Directory
  3017.         AH = 54h
  3018.         AL = subfunction
  3019.             00h get handle directory
  3020.                ES:DI = pointer to buffer for handle directory
  3021.             01h search for named handle
  3022.                DS:SI = pointer to 8-byte name
  3023.             02h get total number of handles
  3024. Return: AL = number of entries in handle directory (subfunction 00h)
  3025.         DX = value of named handle (subfunction 01h)
  3026.         BX = total number of handles (subfunction 02h)
  3027.         AH = status
  3028.             00h successful
  3029.             80h internal error
  3030.             81h hardware malfunction
  3031.             84h undefined function requested
  3032.             8Fh undefined subfunction
  3033.             A0h no such handle name
  3034.             A1h a handle found had no name
  3035. -----------------------------------------------------------
  3036. INT 67 - LIM EMS 4.0 - Alter Page Map and Jump
  3037.         AH = 55h
  3038.         AL = subfunction
  3039.             00h physical page numbers provided by caller
  3040.             01h segment addresses provided by caller
  3041.         DX = handle
  3042.         DS:SI = pointer to structure containing map and jump address
  3043. Return: (at target address unless error)
  3044.         AH = status
  3045.             00h successful
  3046.             80h internal error
  3047.             81h hardware failure
  3048.             83h invalid handle
  3049.             84h undefined function requested
  3050.             8Ah invalid logical page number encountered
  3051.             8Bh invalid physical page number encountered
  3052.             8Fh invalid subfunction
  3053. -----------------------------------------------------------
  3054. INT 67 - LIM EMS 4.0 - Alter Page Map and Call
  3055.         AH = 56h
  3056.         AL = subfunction
  3057.             00h physical page numbers provided by caller
  3058.                DX = handle
  3059.                DS:SI = pointer to structure containing page map and call address
  3060.             01h segment addresses provided by caller
  3061.                DX = handle
  3062.                DS:SI = pointer to structure containing page map and call address
  3063.             02h get page map stack space required
  3064. Return: (if successful, the target address is called.  Use a RETF to return and
  3065.          restore mapping context)
  3066.         BX = stack space required (subfunction 02h)
  3067.         AH = status
  3068.             00h successful
  3069.             80h internal error
  3070.             81h hardware failure
  3071.             83h invalid handle
  3072.             84h undefined function requested
  3073.             8Ah invalid logical page number encountered
  3074.             8Bh invalid physical page number encountered
  3075.             8Fh undefined subfunction
  3076. -----------------------------------------------------------
  3077. INT 67 - LIM EMS 4.0 - Move/Exchange Memory Region
  3078.         AH = 57h
  3079.         AL = subfunction
  3080.             00h move memory region
  3081.             01h exchange memory region
  3082.         DS:SI = pointer to structure describing source and destination
  3083. Return: AH = status
  3084.             00h successful
  3085.             80h internal error
  3086.             81h hardware failure
  3087.             83h invalid handle
  3088.             84h undefined function requested
  3089.             8Ah invalid logical page number encountered
  3090.             8Fh undefined subfunction
  3091.             92h successful, but a portion of the source region has been
  3092.                 overwritten
  3093.             93h length of source or destination region exceeds length of region
  3094.                 allocated to either source or destination handle
  3095.             94h conventional and expanded memory regions overlap
  3096.             95h offset within logical page exceeds size of logical page
  3097.             96h region length exceeds 1M
  3098.             97h source and destination EMS regions have same handle and overlap
  3099.             98h memory source or destination type undefined
  3100.             A2h attempted to wrap around 1M conventional address space
  3101. -----------------------------------------------------------
  3102. INT 67 - LIM EMS 4.0 - Get Mappable Physical Address Array
  3103.         AH = 58h
  3104.         AL = subfunction
  3105.             00h get mappable physical address array
  3106.                ES:DI = pointer to buffer to be filled with array
  3107.             01h get number of entries in m.p.a. array
  3108. Return: CX = number of entries in array
  3109.         AH = status
  3110.             00h successful
  3111.             80h internal error
  3112.             81h hardware failure
  3113.             84h undefined function requested
  3114.             8Fh undefined subfunction
  3115. -----------------------------------------------------------
  3116. INT 67 - LIM EMS 4.0 - Get Expanded Memory Hardware Information
  3117.         AH = 59h
  3118.         AL = subfunction
  3119.             00h get hardware configuration array
  3120.                ES:DI = pointer to buffer to be filled with array
  3121.             01h get unallocated raw page count
  3122. Return: BX = unallocated raw pages (subfunction 01h)
  3123.         DX = total raw pages (subfunction 01h)
  3124.         AH = status
  3125.             00h successful
  3126.             80h internal error
  3127.             81h hardware failure
  3128.             84h undefined function requested
  3129.             8Fh undefined subfunction
  3130.             A4h access denied by operating system
  3131. Note: subfunction 00h is for use by operating systems only, and can be
  3132.       enabled or disabled at any time by the operating system
  3133. -----------------------------------------------------------
  3134. INT 67 - LIM EMS 4.0 - Allocate Standard/Raw Pages
  3135.         AH = 5Ah
  3136.         AL = subfunction
  3137.             00h allocate standard pages
  3138.             01h allocate raw pages
  3139.         BX = number of pages to allocate
  3140. Return: DX = handle
  3141.         AH = status
  3142.             00h successful
  3143.             80h internal error
  3144.             81h hardware failure
  3145.             84h undefined function requested
  3146.             85h no more handles available
  3147.             87h insufficient memory pages in system
  3148.             88h insufficient memory pages available
  3149.             8Fh undefined subfunction
  3150. -----------------------------------------------------------
  3151. INT 67 - LIM EMS 4.0 - Alternate Map Register Set
  3152.         AH = 5Bh
  3153.         AL = subfunction
  3154.             00h get alternate map register set
  3155.             01h set alternate map register set
  3156.                BL = new alternate map register set number
  3157.                ES:DI = pointer to map register context save area if BL=0
  3158.             02h get alternate map save array size
  3159.             03h allocate alternate map register set
  3160.             04h deallocate alternate map register set
  3161.                BL = number of alternate map register set
  3162. Return: BL = current active alternate map register set number if nonzero (AL=0)
  3163.         ES:DI = pointer to a map register context save area if BL=0 (AL=0)
  3164.         DX = array size in bytes (subfunction 02h)
  3165.         BL = number of alternate map register set; zero if not supported (AL=3)
  3166.         AH = status
  3167.             00h successful
  3168.             80h internal error
  3169.             81h hardware malfunction
  3170.             84h undefined function requested
  3171.             8Fh undefined subfunction
  3172.             9Ah specified alternate map register set not supported
  3173.             9Bh all alternate map register sets currently allocated
  3174.             9Ch alternate map register sets not supported
  3175.             9Dh undefined or unallocated alternate map register set
  3176.             A3h source array corrupted
  3177.             A4h operating system denied access
  3178. Note: this function is for use by operating systems only, and can be
  3179.       enabled or disabled at any time by the operating system
  3180. -----------------------------------------------------------
  3181. INT 67 - LIM EMS 4.0 - Alternate Map Register Set - DMA registers
  3182.         AH = 5Bh
  3183.         AL = subfunction
  3184.             05h allocate DMA register set
  3185.             06h enable DMA on alternate map register set
  3186.                BL = DMA register set number
  3187.                DL = DMA channel number
  3188.             07h disable DMA on alternate map register set
  3189.                BL = DMA register set number
  3190.             08h deallocate DMA register set
  3191.                BL = DMA register set number
  3192. Return: BL = DMA register set number; zero if not supported (subfunction 05h)
  3193.         AH = status
  3194.             00h successful
  3195.             80h internal error
  3196.             81h hardware malfunction
  3197.             84h undefined function requested
  3198.             8Fh undefined subfunction
  3199.             9Ah specified DMA register set not supported
  3200.             9Bh all DMA register sets currently allocated
  3201.             9Ch alternate DMA sets not supported
  3202.             9Dh undefined or unallocated DMA register set
  3203.             9Eh dedicated DMA channels not supported
  3204.             9Fh specified dedicated DMA channel not supported
  3205.             A3h source array corrupted
  3206.             A4h operating system denied access
  3207. Note: this function is for use by operating systems only, and can be
  3208.       enabled or disabled at any time by the operating system
  3209. -----------------------------------------------------------
  3210. INT 67 - LIM EMS 4.0 - Prepare Expanded Memory Hardware for Warm Boot
  3211.         AH = 5Ch
  3212. Return: AH = status
  3213.             00h successful
  3214.             80h internal error
  3215.             81h hardware malfunction
  3216.             84h undefined function requested
  3217. -----------------------------------------------------------
  3218. INT 67 - LIM EMS 4.0 - Enable/Disable OS Function Set Functions
  3219.         AH = 5Dh
  3220.         AL = subfunction
  3221.             00h enable OS Function Set
  3222.             01h disable OS Function Set
  3223.             02h return access key (resets memory manager, returns access key at
  3224.                 next invocation)
  3225.         BX,CX = access key returned by first invocation
  3226. Return: BX,CX = access key, returned only on first invocation of function
  3227.         AH = status
  3228.             00h successful
  3229.             80h internal error
  3230.             81h hardware malfunction
  3231.             84h undefined function requested
  3232.             8Fh undefined subfunction
  3233.             A4h operating system denied access
  3234. -----------------------------------------------------------
  3235. INT 68 -> unused
  3236. -----------------------------------------------------------
  3237. INT 69 -> unused
  3238. -----------------------------------------------------------
  3239. INT 6A -> unused
  3240. -----------------------------------------------------------
  3241. INT 6B -> unused
  3242. -----------------------------------------------------------
  3243. INT 6C -> unused
  3244. -----------------------------------------------------------
  3245. INT 6D -> unused
  3246. -----------------------------------------------------------
  3247. INT 6E -> unused
  3248. -----------------------------------------------------------
  3249. INT 6F -> unused
  3250. -----------------------------------------------------------
  3251. INT 70 thru 77 - AT Vectored Hardware Lines
  3252.         IRQ8    -       real-time clock
  3253.         IRQ9    -       LAN adapter 1 (rerouted to INT 0Ah by BIOS)
  3254.         IRQ10   -       reserved
  3255.         IRQ11   -       reserved
  3256.         IRQ12   -       reserved
  3257.         IRQ13   -       80287 error (rerouted to INT 2 by BIOS)
  3258.         IRQ14   -       fixed disk
  3259.         IRQ15   -       reserved
  3260. -----------------------------------------------------------
  3261. INT 86 - Relocated (by NETBIOS) INT 18
  3262. -----------------------------------------------------------
  3263. INT E4 - Logitech Modula v2.0 - MonitorEntry
  3264.         AX = 5
  3265.         BX = priority
  3266. -----------------------------------------------------------
  3267. INT E4 - Logitech Modula v2.0 - MonitorExit
  3268.         AX = 6
  3269. -----------------------------------------------------------
  3270. INT F8 - INTERVAL TIMER (10 MSEC)
  3271. -----------------------------------------------------------
  3272. INT FA - USART READY (RS-232C)
  3273. -----------------------------------------------------------
  3274. INT FB - USART Rx READY (keyboard)
  3275. -----------------------------------------------------------
  3276.  
  3277. INT 67 - LIM EMS 4.0 - Get/Set Handle Name
  3278. *-*-*---------cut-----------cut----------------cut--------------*-*-*
  3279. Append part 3 here.
  3280.  
  3281. --
  3282. {harvard,uunet,ucbvax}!b.gp.cs.cmu.edu!ralf -=-=- AT&T: (412)268-3053 (school)
  3283. ARPA: RALF@B.GP.CS.CMU.EDU |"Tolerance means excusing the mistakes others make.
  3284. FIDO: Ralf Brown at 129/31 | Tact means not noticing them." --Arthur Schnitzler
  3285.